나루다루

SAS BASE Q67. 문자형/숫자형 변수 본문

Study/SAS BASE

SAS BASE Q67. 문자형/숫자형 변수

나루다루 2018. 11. 2. 01:08
728x90
반응형

QUESTION NO: 67

Given the raw data file AMOUNT:

$1,234

 

The following SAS program is submitted:

data test;

infile 'amount';

input@1 salary 6.;

if _error_ then description = '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.

 

 

Answer: B





# 문제 풀이

 - $1,234는 문자형 변수인데, 데이터셋을 생성할 때 salary 변수는 숫자형 변수이다. 

 - 따라서 에러가 발생하고, if 구문에 따라서 description에는 'Problems'가 표시된다.

728x90
반응형

'Study > SAS BASE' 카테고리의 다른 글

SAS BASE Q69. first/last  (0) 2018.11.02
SAS BASE Q68. input @ (???)  (0) 2018.11.02
SAS BASE Q66. ods html  (0) 2018.11.02
SAS BASE Q65. cat & catx & !!  (0) 2018.11.02
SAS BASE Q64. keep  (0) 2018.11.02
Comments