A00-211 Exam QuestionsBrowse all questions from this exam

A00-211 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"?

Show Answer
Correct Answer: B,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

3 comments
Sign in to comment
KleinstoneOption: D
Jan 3, 2021

is the answer D?

mhminkovOption: A
Jun 5, 2021

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 ;

CHENTEPEOption: D
Aug 2, 2023

D IS THE ANSWER