A00-211 Exam QuestionsBrowse all questions from this exam

A00-211 Exam - Question 44


The following SAS program is submitted:

data work.test;

Title = 'A Tale of Two Cities, Charles J. Dickens';

Word = scan(title,3,' ,');

run;

Which one of the following is the value of the variable WORD in the output data set?

Show Answer
Correct Answer: B

The SCAN function in SAS extracts words from a string based on specified delimiters. In this program, the delimiters specified are space and comma (' ,'). The program will tokenize the title 'A Tale of Two Cities, Charles J. Dickens' using these delimiters. The third word, considering spaces and commas as delimiters, is 'of'.

Discussion

2 comments
Sign in to comment
MTKV18Option: B
Jun 23, 2023

Answer should be B, delimiters mentioned are space and comma so the third word will be correct for this

DEAWSOption: B
Feb 7, 2024

the placement of the quotations around the delimiter the comma, is critical – if there were NO space (‘,’), the value returned would be ‘ ‘ (missing character value). However, having the space before the delimiter (' ,') returns the 'of', so it is 'B' instead of 'D'.''' So Correct Answer is : B