SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Reading Raw Data
Submitting the DATA Step Program


Invalid Data

When you submit the revised DATA step and check the log, you see a note indicating that invalid data appears for the variable  RecHR in line 14 of the raw data file, columns 35-37.

This note is followed by a column ruler and the actual data line showing the invalid value for RecHR.


NOTE: Invalid data for RecHR in line 14 35-37.
RULE:     ----+----1----+----2----+----3----+----4----+----5---
14        2575 Quigley, M           74  152 Q13 11 26 I 45
ID=2575 Name=Quigley, M RestHR=74 MaxHR=152 RecHR=. TimeMin=11
TimeSec=26 Tolerance=I _ERROR_=1
_N_=14
NOTE: 21 records were read from the infile TESTS.
      The minimum record length was 45.
      The maximum record length was 45.
NOTE: The data set CLINIC.STRESS has 21 observations 
      and 8 variables.
NOTE: DATA statement used:
      real time           2.04 seconds
      cpu time            0.06 seconds


The value Q13 is a data entry error, incorrectly entered for the variable RecHR.

RecHR is a numeric variable, but Q13 is not a valid number. So RecHR is assigned a missing value, as indicated in the log. Because RecHR is numeric, the missing value is represented with a period.

Notice, though, that the DATA step does not fail as a result of the invalid data but continues to execute. Unlike syntax errors, invalid data errors do not cause the SAS System to stop processing a program.

Assuming that you have a way to to edit the file and can justify a correction, the best course of action is to correct the invalid value and rerun the DATA step. If you did this, the log would then show that the data set Clinic.Stress was created with 21 observations, 8 variables,  and no messages about invalid data.


NOTE: The infile TESTS2 is:
      File Name=C:\My SAS Files\tests2.dat,
      RECFM=V,LRECL=256

NOTE: 21 records were read from the infile TESTS2.
      The minimum record length was 45.
      The maximum record length was 45.
NOTE: The data set CLINIC.STRESS has 21 observations 
      and 8 variables.
NOTE: DATA statement used:
      real time           0.40 seconds
      cpu time            0.10 seconds



back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement