Submitting the DATA Step Program

Verifying the Data

To verify your data, it is a good idea to use the OBS= option in the INFILE statement. Adding OBS=n to the INFILE statement enables you to process only records 1 through n, so you can verify that the correct fields are read before reading the entire data file.
The program below reads the first ten records in the raw data file referenced by the fileref Tests. The data is stored in a permanent SAS data set, named Sasuser.Stress. Don't forget a RUN statement, which tells SAS to execute the previous SAS statements.
data sasuser.stress; 
   infile tests obs=10; 
   input ID $ 1-4 Name $ 6-25  
         RestHR 27-29 MaxHR 31-33 
         RecHR 35-37 TimeMin 39-40  
         TimeSec 42-43 Tolerance $ 45; 
run;
SAS Data Set sasuser.stress ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.