문제풀이/기타
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
반응형