SAS Base, A00-211 Crambible 

SAS 베이스 자격증 


QUESTION NO: 67

Given the raw data file AMOUNT: 

----I---- 10---I----20---I----30
$1,234

The following SAS program is submitted: 

data test;

infile'amount';
input@1 salary 6.; 

if_error_thendescription = 'Problems'; 

else description = 'No Problems';
run;


What is the result?

A. The value of the DESCRIPTION variable is NoProbl.

B. The value of the DESCRIPTION variable is Problems.
C. The value of the DESCRIPTION variable is No Problems.

D. The value of the DESCRIPTION variable can not be determined.


amount를 불러와서 test라는 데이터를 만들려고 하는데요. input구문을 이용해서 첫번째부터 불러와서 6자리 salary변수를 만들려고 하는데요. if 구문에서 만약 에러가 발생하면 'Problmes'라는 description을 만들고, 에러가 없으면 'No Problems'라고 표현하라는것입니다. 


에러가 나는지 안나는지 봐야하는데요. 왜냐하면 salary변수에는 $ 표시가 없는걸 보니 수치형 변수라고 선언했는데 amount 보니까 $ (달러) 도 있고 , 도 있어서 문자형 변수입니다. 문자형 변수를 숫자형변수로 바꾸려고 하니 에러가 생기게 되겠죠.


Answer: B 


반응형

+ Recent posts