나루다루

SAS BASE Q49. if문 본문

Study/SAS BASE

SAS BASE Q49. if문

나루다루 2018. 10. 31. 22:10
728x90
반응형

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

 

 

Answer: C





# 문제 풀이

 - amount=4이므로 if문에서 word='FOUR' 할당. if문을 만족했으므로 else문은 실행하지 않음. 그 후에 amount에 7을 할당.


 - 실제 데이터셋을 생성하면 word amount순으로 생성된다.

728x90
반응형

'Study > SAS BASE' 카테고리의 다른 글

SAS BASE Q51. 세미콜론(;) / 추가 문제  (0) 2018.10.31
SAS BASE Q50. 문자형 변수  (0) 2018.10.31
SAS BASE Q48. select ~ when 구문  (0) 2018.10.31
SAS BASE Q47. sas catalog & format  (0) 2018.10.31
SAS BASE Q46. input+1 옵션[수정]  (0) 2018.10.31
Comments