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

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.