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

The following SAS program is submitted:

data work.flights;

destination = cph;

select(destination);

when(LHR) city = London;

when(CPH) city = Copenhagen;

otherwise city = Other;

end;

run;

What is the value of the CITY variable?

    Correct Answer: D

    In the given SAS program, destination is assigned the value cph without quotation marks, which means it is treated as a variable rather than a character string. Since the variable cph has not been previously defined or assigned a value, it remains as a missing character value. Therefore, when the SELECT statement evaluates the destination value, no WHEN conditions match, and the OTHERWISE statement sets the variable city to 'Other'. But since there is no valid input for the SAS system, the result should be a missing character value for the CITY variable.

Discussion
KleinstoneOption: A

all these strings should have quotation marks. Then the answer is A.

Misty2287

My second day in using these tests. Just so tired of SAS code with so many typos and incorrect syntax. How irresponsible....

KleinstoneOption: B

the answer should be B, unless chp is in citation mark, cph and CPH are the same.