SAS Base, A00-211 Crambible 

SAS 베이스 자격증 


QUESTION NO: 49


The following SAS program is submitted: 

data work.new;
length word $7;
amount = 4;

if amount = 4 then word = 'FOUR'; else if amount = 7
then word = 'SEVEN';
else word = 'NONE!!!';

amount = 7; 

run;


What are the values of the AMOUNT and WORD variables in SAS dataset work.new?


A. amount word 

     4 FOUR 

B. amount word 

    4 NONE!!! 

C. amount word 

    7 FOUR 

D. amount word 

    7 SEVEN


work.new 데이터를 만들려고 하는데요. 

word의 길이는 7로 지정합니다. amount에 값 4 값을 넣어줬습니다. 


it amount = 4 then word = 'FOUR'; else if amount = 7

지금 amount가 4라서 if 조건문이 맞아 FOUR라는 단어를 넣어줬고요. else구문은 skip하게 됩니다. 그리고 amount = 7, 다시 amount 값이 7로 들어가게 되었네요. 

따라서 amount는 7이고, word는 FOUR이 되었습니다. 



Answer: C 


반응형

+ Recent posts