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

A SAS PRINT procedure output of the WORK.LEVELS data set is listed below:

Obs name level -

1 Frank 1

2 Joan 2

3 Sui 2

4 Jose 3

5 Burt 4

6 Kelly .

7 Juan 1

The following SAS program is submitted:

data work.expertise;

set work.levels;

if level = . then

expertise = 'Unknown';

else if level = 1 then

expertise = 'Low';

else if level = 2 or 3 then

expertise = 'Medium';

else

expertise = 'High';

run;

Which of the following values does the variable EXPERTISE contain?

    Correct Answer: C

    The variable EXPERTISE will contain the values 'Low', 'Medium', 'High', and 'Unknown'. The logic in the program handles the different values of the variable LEVEL, assigning 'Low' if LEVEL equals 1, 'Medium' if LEVEL equals 2 or 3, 'High' for other non-missing values, and 'Unknown' if LEVEL is missing. Since the data set contains all these scenarios, the resulting variable EXPERTISE will reflect all these values.

Discussion
mhminkovOption: D

the given answer is correct, but it is tricky to guess the effect of wrong syntax ("else if level = 2 or 3 then ..." should be: "else if level = 2 or level = 3 then ...") on the program behavior.