A00-211 Exam QuestionsBrowse all questions from this exam

A00-211 Exam - Question 38


The contents of the raw data file EMPLOYEE are listed below:

--------10-------20-------30

Ruth 39 11 -

Jose 32 22 -

Sue 30 33 -

John 40 44 -

The following SAS program is submitted:

data test;

infile 'employee';

input employee_name $ 1-4;

if employee_name = 'Sue' then input age 7-8;

else input idnum 10-11;

run;

Which one of the following values does the variable AGE contain when the name of the employee is "Sue"?

Show Answer
Correct Answer: BC

The SAS program reads the raw data file 'EMPLOYEE' and inputs the employee name from columns 1 to 4. When the employee name is 'Sue', the program reads the age from columns 7 to 8. In the data provided, the employee Sue has the age 33 in columns 7 to 8, so the value of the variable AGE when the employee name is 'Sue' is 33.

Discussion

2 comments
Sign in to comment
KleinstoneOption: D
Jan 18, 2021

why is 40? should be D missing?

mhminkov
Jun 4, 2021

this question and answers make no sense to me, .. the input statement is wrong, one can not predict the program behavior. When I run the code result is 0, which is not in the listed answers. I think given answer is wrong.