SAS Base Programming for SAS 9 — Question 5
The following SAS program is submitted:
data work.empsalary;
set work.people (in = inemp)
work.money (in = insal);
if insal and inemp;
run;
The SAS data set WORKPEOPLE has 5 observations, and the data set WORKMONEY has 7 observations. How many observations will the data set
WORK.EMPSALARY contain?
Answer options
- A. 0
- B. 5
- C. 7
- D. 12
Correct answer: A
Explanation
The correct answer is A because the condition 'if insal and inemp' requires observations to be present in both datasets for them to be included in WORK.EMPSALARY. Since there are no common observations between WORK.PEOPLE and WORK.MONEY, the resulting dataset will contain 0 observations. The other options suggest non-zero counts, which are incorrect.