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
'SAS > Base Programmer' 카테고리의 다른 글
[A00-211, Crambible] SAS Q51 - ; (1) | 2017.05.28 |
---|---|
[A00-211, Crambible] SAS Q50 - $ 문자형변수 (0) | 2017.05.28 |
[A00-211, Crambible] SAS Q48 - select & end (0) | 2017.05.28 |
[A00-211, Crambible] SAS Q47- catalog (0) | 2017.05.28 |
[A00-211, Crambible] SAS Q46 - input (0) | 2017.05.28 |