나루다루

SAS BASE Q3. length 구문 본문

Study/SAS BASE

SAS BASE Q3. length 구문

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

QUESTION NO: 3

The following SAS program is submitted:

data work.accounting;

set work.dept1 work.dept2;

jobcode= 'FA1';

length jobcode $ 8;

run;

 

A character variable named JOBCODE is contained in both the WORK.DEPT1 and WORK.DEPT2 SAS data sets. The variable JOBCODE has a length of 5 in the WORK.DEPT1 data set and a length of 7 in the WORK.DEPT2 data set. What is the length of the variable JOBCODE in the output data set?

 

A. 3

B. 5

C. 7

D. 8

 

 

Answer: B






# 문제 풀이

 - 변수의 길이 설정은 가장 처음 설정을 따른다. 뒤에 수정을 한다고 바뀌지 않는다.


 - set work.dept1이 가장 먼저 실행되므로, dept1의 길이 설정에 따른다.


 - 만약 length jobcode $ 8가 data와 set 구문 사이에 있으면, length는 8이 된다.


728x90
반응형

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

SAS BASE Q5. footnote  (0) 2018.02.11
SAS BASE Q4. if & output [수정] / 15,20번과 비교  (1) 2018.02.11
SAS BASE Q2. set & in & pdv  (0) 2018.02.11
SAS BASE Q1. label 설정  (0) 2018.02.11
SAS BASE 덤프(크램바이블, 킬테스트)  (0) 2018.02.03
Comments