To use this program, follow these steps:
  1. Open a SAS editor window (or another text editor)
  2. COPY the program below and PASTE it into the editor window
  3. Edit the program so that the FILE= specification points to where the data file is stored on your system
  4. Save the modified program file and RUN it using SAS
The program is below this line. If no program is listed, the URL to the EML document may be in error. If the EML file does not include all the information needed, the SAS program will have errors or be incomplete.

* Package ID: knb-lter-vcr.27.4;
* Cataloging System:VCR; 
* Data set title: Temporal and spatial distribution of microbial biomass, growth and activity. 1988-90.; 
* Data set creator: Dr. Aaron Mills -  ; 
* Data set creator: Dr. Aaron Mills -  ; 
* Metadata Provider:    - Virginia Coast Reserve Long-Term Ecological Research Project ; 
* Contact: Dr. Aaron Mills -    - amills@virginia.edu; 
* Contact: Dr. Aaron Mills -    - amills@virginia.edu; 
* Contact:    - Information manager - Virginia Coast Reserve Long-Term Ecological Research Project   - jporter@lternet.edu; 
        
Title1 ' Temporal and spatial distribution of microbial biomass, growth and activity. 1988-90.' ; 
/* 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                          
                                    @3 YEAR 2.  
                                    @5 MONTH 2.  
                                    @7 DAY 2.  
                                    @10 SITEID  $ 3.     
                                    @26 WATSAMP 1.  
                                    @28 WATAO     
                                    @44 SEDSAMP 1.  
                                    @46 SEDAO    ; 
if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */  
IF (WATAO EQ 0) THEN WATAO= . ;  
IF (SEDAO EQ 0) THEN SEDAO= . ;  
LABEL YEAR ='Year-YY' ; 
LABEL MONTH ='Month-MM' ; 
LABEL DAY ='Day-DD' ; 
LABEL SITEID ='CODE FOR STATION NAME IMPLICIT LOCATION-' ; 
LABEL WATSAMP ='ID NUMBER OF REPLICATE WATER SAMPLES COLLECTED IN STATION-none' ; 
LABEL WATAO ='NUMBER OF BACTERIAL CELLS PER ML WATER-CELLS/ML' ; 
LABEL SEDSAMP ='ID NUMBER OF REPLICATE SEDIMENT SAMPLE-none' ; 
LABEL SEDAO ='NUMBER OF BACTERIAL CELLS/ML WET SEDIMENT-CELLS/ML' ;
run;
                
                
                
/* The analyses below are basic descriptions of the variables.
   After testing, they should be replaced. */
                
                
PROC FREQ; 
      TABLES  SITEID;  
PROC MEANS; 
        VAR YEAR ;  
PROC MEANS; 
        VAR MONTH ;  
PROC MEANS; 
        VAR DAY ;  
PROC MEANS; 
        VAR WATSAMP ;  
PROC MEANS; 
        VAR WATAO ;  
PROC MEANS; 
        VAR SEDSAMP ;  
PROC MEANS; 
        VAR SEDAO ; 
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 ((YEAR NE .) AND (YEAR LT 1)) THEN BADVARS=CAT(TRIM(BADVARS),' YEAR-min'); 
IF ((YEAR NE .) AND (YEAR GT 99)) THEN BADVARS=CAT(TRIM(BADVARS),' YEAR-max'); 
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 ((WATSAMP NE .) AND (WATSAMP LT 1)) THEN BADVARS=CAT(TRIM(BADVARS),' WATSAMP-min'); 
IF ((WATSAMP NE .) AND (WATSAMP GT 3)) THEN BADVARS=CAT(TRIM(BADVARS),' WATSAMP-max'); 
IF ((WATAO NE .) AND (WATAO LT 10000)) THEN BADVARS=CAT(TRIM(BADVARS),' WATAO-min'); 
IF ((WATAO NE .) AND (WATAO GT 10000000000)) THEN BADVARS=CAT(TRIM(BADVARS),' WATAO-max'); 
IF ((SEDSAMP NE .) AND (SEDSAMP LT 1)) THEN BADVARS=CAT(TRIM(BADVARS),' SEDSAMP-min'); 
IF ((SEDSAMP NE .) AND (SEDSAMP GT 3)) THEN BADVARS=CAT(TRIM(BADVARS),' SEDSAMP-max'); 
IF ((SEDAO NE .) AND (SEDAO LT 10000000)) THEN BADVARS=CAT(TRIM(BADVARS),' SEDAO-min'); 
IF ((SEDAO NE .) AND (SEDAO GT 10000000000)) THEN BADVARS=CAT(TRIM(BADVARS),' SEDAO-max'); 
IF (BADVARS NE ''); 
PROC PRINT data=bad1; 
RUN;