SAS Base, A00-211 Crambible, SAS 크램바이블 

SAS 베이스 자격증, SAS 문제풀이


QUESTION NO: 149

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? 


A.1 

B. 6

C. 15 

D. 200


크램바이블에서 답은 D로 되어있는데요. 사실 SAS 9.4 버전에서는 답이 200이 맞지만 버전이 바뀐 뒤로는 200이 아니라 15가 답입니다. output은 아래 그림과 같고요. 


scan 함수의 길이가 따로 지정되지 않으면 첫번째 값(argument)이 길이로 지정된다고 합니다. 





Answer: D C


반응형

+ Recent posts