문제풀이/기타

SAS BASE Q37. a+b / Q19와 비교

나루다루 2018. 10. 31. 00:50
728x90

QUESTION NO: 37

Given the raw data file YEARAMT:

1901 2

1905 1

1910 6

1925 .

1941 1

 

The following SAS program is submitted:

data coins;

infile 'yearamt';

input year quantity;

<insert statement(s) here>

run;

 

Which statement(s) completed the program and produced a non-missing value for the variable TOTQUANTITY in the final observation of the output data set?

 

A. totquantity + quantity;

B. totquantity = sum(totquantity + quantity);

C. retain totquantity; totquantity = totquantity + quantity;

D. retain totquantity0; totquantity = totquantity + quantity;

 

 

Answer: A





# 문제 풀이

 - Q19번과 비교해봤을 때 약간 혼란이 생길 수 있다. 다시 정리하자면, a=결측 b=10일 때

  - c=a+b : c에는 결측값이 저장된다.

  - a+b : a에는 결측값이 아닌 10이 저장된다. 

  - c=sum(a,b) : c에 10이 저장된다.

=> 따라서 답이 A번이 된다.





728x90
반응형