You need to login to view this content. Please
Login. Not a Member?
Join Us
Log:
16 data work.homework;
17 input name $ age height;
18 infile 'file-specification';
19 if age LE 10;
20
NOTE: Invalid data for age in line 21 6-14.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9-
21 John McCloskey 35 71
name=John age=. height=35 _ERROR_=1 _N_=1
NOTE: Invalid data for age in line 22 6-14.
22 June Rosesette 10 43
name=June age=. height=10 _ERROR_=1 _N_=2
NOTE: Invalid data for age in line 23 8-12.
23 Tineke Jones 9 37
name=Tineke age=. height=9 _ERROR_=1 _N_=3
NOTE: The data set WORK.HOMEWORK has 3 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds
24 ;
25 run;
Commentary:
The list Input method used to read file variables name, age and height will be read by SAS in order with a space as the delimiter in this case. The variable age is of numeric type so SAS will try to read a string for this variable and assign a missing value (see the log above). In SAS, a missing value is always less than any numeric value, so the statement if age LE 10; will be true for each processed record and a record will be written to the output.
Data Set(s):
