A00-211 Exam QuestionsBrowse all questions from this exam

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

Show Answer
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

4 comments
Sign in to comment
piycc09
Jul 5, 2021

Why answer is D?

mhminkov
Dec 4, 2021

correct answer is C, length is 15

Mandar77
Dec 23, 2022

Answer is C which is 15. Executed program and checked

DEAWS
Aug 14, 2024

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