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?
A. T
B. of
C. Dickens
D. ‘ ‘ (missing character value)
Answer is B. Be very careful about the space right before the comma! It tells you the blank is also a delimiter. If there is no space right before the comma, then the answer should be D.
The correct answer is B