Exam A00-211 All QuestionsBrowse all questions from this exam
Question 2

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?

    Correct Answer: A

    When the SAS program is executed, the IF statement 'if insal and inemp;' ensures that only those observations which are present in both data sets, work.people and work.money, will be included in the resulting data set, work.empsalary. This is essentially performing an inner join operation. Since there are no identification variables mentioned to match observations between the work.people and work.money data sets, we can assume that no observations meet the condition of being present in both data sets. Therefore, the resulting data set, WORK.EMPSALARY, will contain 0 observations.

Discussion
Lisa_LOption: A

The crucial part of the program is the IF statement: if insal and inemp;. This line means that an observation will be included in the WORK.EMPSALARY data set only if it is present in both work.people (indicated by inemp) and work.money (indicated by insal). Therefore, no observations will meet the if insal and inemp; condition.

_124Option: D

I think D is correct

Mandar77Option: A

Answer A is right. I think, IN option is mostly used when we are merging datasets. Also, it need by statement and both datasets must be sorted. I never seen example while learning where you are concatenating the datasets.

nbav

Sorry about the wrong code below please ignore it.

nbavOption: A

A is the correct answer. 0 obs. Run the following code and try to understand what is going on in the in= option. Uncomment the if statement and run it aging. You will get 0 obs. DATA CAFE(KEEP=NAME PLACE CNUM); INPUT NAME $ ; PLACE = 'CAFE '; CNUM = 'C' || LEFT(PUT(_N_,2.)); DATALINES; ANDERSON COOPER DIXON FREDERIC FREDERIC PALMER RANDALL RANDALL SMITH SMITH SMITH ; RUN; DATA VENDING (KEEP=NAME PLACE VNUM); INPUT NAME $ ; PLACE = 'VENDING '; VNUM = 'V' || LEFT(PUT(_N_,2.)); DATALINES; CARTER DANIELS GARY GARY HODGE PALMER RANDALL RANDALL SMITH SMITH SPENCER SPENCER SPENCER SPENCER ; RUN; DATA ALL; set CAFE(IN=CAFEIN) SNACK(IN=SNACKIN); CIN=CAFEIN; SIN=SNACKIN; *if CIN and SIN; RUN;

KleinstoneOption: D

should be D.12?

Suhan

reason why 0?