SAS Certified Base Programmer 123 Questions (16)
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 WORK.PEOPLE has 5 observations, and the data set WORK.MONEY has 7 observations. How many observations will the data set WORK.EMPSALARY contain?
A. 0
B. 5
C. 7
D. 12
Topics:
SAS Base Questions |
6 Comments »
A
can you please explain why the answer is A?
hi
sowmya
urvish here
the answer is A jst coz here the condition of IF includes AND clause it means that if both the data sets contributed to all the observations then only observations vl written . and here one contains 5 obs and other contains 7 .
if there OR comparision operator in IF condition then data set empsalary will append as usual .
Does it just check observation count…? That doesnt seem right.. Shouldnt it be looking for matching or intersection of rows where insal and inemp both are available?
Hi,
the ans is right, its because (in = inemp) and (in = insal) cannot be used with SET, it will cause error.
So ‘0’ observation
Hi sudha
urvish is correct, here the problem is If statement with AND combination.