SAS Base Programming for SAS 9 — Question 12
Given the SAS data set SASDATA TWO:
SASDATA TWO -
X Y -
-- --
5 2
3 1
5 6
The following SAS program is submitted:
data sasuser.one two sasdata.three;
set sasdata two;
if x = 5 then output sasuser.one;
else output sasdata two;
run;
What is the result?
Answer options
- A. data set SASUSER.ONE has 5 observations data set SASUSER.TWO has 5 observations data set WORK.OTHER has 3 observations
- B. data set SASUSER.ONE has 2 observations data set SASUSER.TWO has 2 observations data set WORK.OTHER has 1 observations
- C. data set SASUSER.ONE has 2 observations data set SASUSER.TWO has 2 observations data set WORK.OTHER has 5 observations
- D. No data sets are output.
Correct answer: A
Explanation
The correct answer is A because the program outputs records where X equals 5 to SASUSER.ONE and the remaining records to SASDATA.TWO. Since there are two records with X equal to 5, that results in 2 observations in SASUSER.ONE, and the other records are still in SASDATA.TWO, leading to 5 observations in total there. Options B, C, and D are incorrect as they misrepresent the counts of the observations in the respective datasets.