SAS Base, A00-211 Crambible 

SAS 베이스 자격증 


QUESTION NO: 51


The following SAS program is submitted: 


data work.retail;
cost = '20000';
total= .10* cost

run;


What is the result?


A. The value of the variable TOTAL in the output data set is 2000. No messages are written to the SAS log. 


B. The value of the variable TOTAL in the output data set is2000. A note that conversion has taken place is written to the SAS log.


C. The value of the variable TOTAL in the output data set is missing. An error message is written to the SAS log.


D. The variable TOTAL in the output data set has no value. The program fails to execute due to a syntax error.



cost = '20000'; cost는 문자형이네요. 

total= .10* cost 여기 ; 이 없어서 데이터가 만들어지지 않습니다.  (C) 


만약 total= .10* cost; 이렇게 ;이 제대로 들어가게 되면 어떻게 될까요? 

.10*cost 에서 숫자 * 문자는 에러가 나지만 SAS가 알아서 문자를 숫자형으로 바꿔서 계산이 되고 단, log파일에 자신이 숫자형으로 바꿨다고 메시지가 뜨게 됩니다. (B)



Answer: C 


반응형

+ Recent posts