SAS BASE Q34. format의 순서
QUESTION NO: 34
The data set RALESTATE has the variable LOCALFEE with a format of 9. and a variable COUNTRYFEE with a format of 7.;
The following SAS program is submitted:
data history;
format localfee countryfee percent6.;
set realestate;
localfee = localfee / 100;
country fee = countryfee / 100;
run;
What are the formats of the variables LOCALFEE and COUNTRYFEE in the output dataset?
A. LOCALFEE has format of 9. and COUNTRYFEE has a format of 7.
B. LOCALFEE has format of 9. and COUNTRYFEE has a format of percent6.
C. LOCALFEE has format of percent6. and COUNTRYFEE has a format of percent6.
D. The data step fails execution; there is no format for LOCALFEE
Answer: C
# 문제 풀이
- format 구문은 순서에 관계없이 새로 적용한 format이 적용된다.
- 만약 set 뒤에 format 구문이 있더라도 새로 선언한 format이 적용된다. (순서에 상관x)
cf) length 구문은 순서가 중요하다. set 앞에 쓰냐 뒤에 쓰냐가 중요함.