To use this program, follow these steps:
* Package ID: knb-lter-vcr.7.4;
* Cataloging System:VCR;
* Data set title: LTER hurricane record for the Virginia Coast Reserve.;
* Data set creator: Dr. Bruce Hayden - ;
* Metadata Provider: - Virginia Coast Reserve Long-Term Ecological Research Project ;
* Contact: Dr. Bruce Hayden - - bph@virginia.edu;
* Contact: Dr. Bruce Hayden - - bph@virginia.edu;
* Contact: - Information manager - Virginia Coast Reserve Long-Term Ecological Research Project - jporter@lternet.edu;
Title1 ' LTER hurricane record for the Virginia Coast Reserve.' ;
/* You should replace 'PUT-LOCAL-PATH-TO-DATA-FILE-HERE' (below) with the appropriate path;
to your data file (e.g., c:\mydata\datafile.txt). If you want to create a permanent SAS dataset, replace the WORK. specification
in the DATA statement (and SET statement in section for range checking) with a valid SAS Library reference. */
DATA WORK.data1;
%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
infile 'PUT-LOCAL-PATH-TO-DATA-FILE-HERE'
TRUNCOVER;
input
@1 YEAR 4.
@10 MONTH 2.
@17 DAY 2.
@24 CLASS $ 2.
@30 TRACK $ 1.
@36 CROSS $ 10.
@49 NAME $ 37. ;
if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */
LABEL YEAR ='Year of occurence of the storm-none' ;
LABEL MONTH ='Month of occurrence of the storm-none' ;
LABEL DAY ='Day in the month the storm occurred-none' ;
LABEL CLASS ='Classification of the storm based on wind speed-' ;
LABEL TRACK ='The path of the storm-' ;
LABEL CROSS ='Coastal location of storm crossing-' ;
LABEL NAME ='Name of the storm-' ;
/* Codes for CLASS are:
'EX' 'Extratropical - No longer a tropical storm (associated with fronts)'
'H' 'Hurricane (72 mph or greater)'
'TS' 'Tropical Storm (less than 72 miles per hour)' .
*/
/* Codes for TRACK are:
'A' 'Along the shore track. Produces storm surge.'
'I' 'Inland of Virginia Coast Reserve'
'L' 'Landfall: produces storm surge'
'O' 'Track Offshore: little storm surge if any' .
*/
run;
/* The analyses below are basic descriptions of the variables.
After testing, they should be replaced. */
PROC FREQ;
TABLES CLASS;
PROC FREQ;
TABLES TRACK;
PROC FREQ;
TABLES CROSS;
PROC FREQ;
TABLES NAME;
PROC MEANS;
VAR YEAR ;
PROC MEANS;
VAR MONTH ;
PROC MEANS;
VAR DAY ;
RUN;
TITLE2 'Observations with one or more out of range values';
DATA bad1;
SET WORK.data1;
* List cases where data is out of range;
* Note: if no out of range cases are detected, the variable names will be listed, but no actual cases;
LENGTH BADVARS $ 255;
IF ((MONTH NE .) AND (MONTH LT 1)) THEN BADVARS=CAT(TRIM(BADVARS),' MONTH-min');
IF ((MONTH NE .) AND (MONTH GT 12)) THEN BADVARS=CAT(TRIM(BADVARS),' MONTH-max');
IF ((DAY NE .) AND (DAY LT 1)) THEN BADVARS=CAT(TRIM(BADVARS),' DAY-min');
IF ((DAY NE .) AND (DAY GT 31)) THEN BADVARS=CAT(TRIM(BADVARS),' DAY-max');
IF (BADVARS NE '');
PROC PRINT data=bad1;
RUN;