A00-211 Exam QuestionsBrowse all questions from this exam

A00-211 Exam - Question 30


Given the following raw data records in TEXTFILE.TXT:

The following output is desired:

Which SAS program correctly produces the desired output?

Show Answer
Correct Answer: C

The correct SAS program is the one that uses the correct combination of reading in the data and formatting it to achieve the desired output. In Option C, the 'length' statement properly defines the variables: Name, Month, and Status as character variables with appropriate lengths, while the variable Week is numeric. The 'infile' statement with 'dsd' option ensures correctly reading the delimited text file, and the 'input' statement is structured to read the variables correctly depending on the Month value. Finally, the 'format' statement applies dollar formatting to the week variables as required. This combination will produce the output as desired.

Discussion

2 comments
Sign in to comment
JKoOption: C
Jun 4, 2019

The answers here are all wrong. Fix answer c by the following code infile 'TEXTFILE.TXT' dsd ; input Name $ Month $ @;

Kleinstone
Jan 2, 2021

I agree!