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

Given the raw data file EMPLOYEE:

----I----1 0---I----20---I----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 = Ruth then input idnum 10-11;

else input age 7-8;

run;

What value does the variable IDNUM contain when the name of the employee is "Ruth"?

    Correct Answer: D

    In the given SAS program, the value of the variable IDNUM when the name of the employee is 'Ruth' is missing. This is due to the incorrect handling of the input statement. The program should include a trailing @ symbol after the first input statement to hold the input line for further processing. Without this, the input pointer will advance to the next line before evaluating the condition for 'Ruth', leading to a missing numeric value for IDNUM.

Discussion
CHENTEPEOption: D

D IS THE ANSWER

mhminkovOption: A

this question is a mess, .. with corrected code (s. below, especialli adding a @) I get a result of 1. data EMPLOYEE; infile datalines; input employee_name $ 1-4 @; if employee_name = "Ruth" then input idnum 10-11; else input age 7-8; datalines; Ruth 39 11 Jose 32 22 Sue 30 33 John 40 44 ;

KleinstoneOption: D

is the answer D?