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

The following SAS program is submitted:

data test;

set chemists;

jobcode = Chem2

then description = Senior Chemist;

else description = Unknown;

run;

The value for the variable JOBCODE is:

JOBCODE -

-------------

chem2

What is the value of the variable DESCRIPTION?

    Correct Answer: B

    Given the SAS program, the value for the variable JOBCODE is 'chem2' in lowercase. However, the code checks if jobcode is equal to 'Chem2' with an uppercase 'C'. Since 'chem2' does not match 'Chem2' (because SAS is case-sensitive), the condition fails, and the ELSE part of the statement is executed, assigning the value 'Unknown' to the variable DESCRIPTION.

Discussion
mhminkovOption: C

there is also a missing if statement, here the corrected code: data test; infile datalines; if jobcode = "Chem2" then description = "Senior Chemist"; else description = "Unknown"; input JOBCODE $; datalines; chem2 ;

Lisa_LOption: B

Unknown is the answer. JOBCODE is chem2 (lowercase). In the IF statement: if jobcode = 'Chem2' then description = 'Senior Chemist';, C is in capital case. Since the condition does not meet, the ELSE statement would be executed.

Misty2287

why are so many code have typos and incorrect syntax. So frustrating and confusing to go through practices this way.

Kleinstone

with quotation mark?