SAS Base Programming for SAS 9 — Question 32
A raw data file is listed below:
--------10-------20-------30
John McCloskey 35 71 -
June Rosesette 10 43 -
Tineke Jones 9 37 -
The following SAS program is submitted using the raw data file as input: data work.homework; infile 'file-specification'; input name $ age height; if age LE 10; run;
How many observations will the WORK.HOMEWORK data set contain?
Answer options
- A. 0
- B. 2
- C. 3
- D. No data set is created as the program fails to execute due to errors.
Correct answer: C
Explanation
The correct answer is C because the condition 'if age LE 10' filters in records where age is less than or equal to 10. In the raw data, Tineke Jones has an age of 9, which meets this criterion, thus resulting in one valid observation. The others do not meet the condition, leading to a total of 3 observations not being included. Therefore, the dataset will contain one observation only.