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

The following SAS program is submitted:

data work.test;

Author = 'Agatha Christie';

First = substr(scan(author,1,' ,'),1,1);

run;

Which one of the following is the length of the variable FIRST in the output data set?

    Correct Answer: A

    The length of the variable FIRST is determined by analyzing the SAS program. The FIRST variable is created by extracting the first character from the first word in the variable AUTHOR using the SUBSTR and SCAN functions. Since the length of the SUBSTR function is specified as 1, the length of the variable FIRST is 1.

Discussion
DEAWSOption: C

o/p is : 15 data work.test; Author = 'Agatha Christie'; First = substr(scan(author,1,' ,'),1,1); length = lengthc(first); run;

Mandar77Option: C

Answer is C which is 15. Executed program and checked

mhminkovOption: C

correct answer is C, length is 15

piycc09Option: D

Why answer is D?