SAS Base (20)

The data set WORK.REALESTATE 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 WORK.FEE_STRUCTURE;
format LocalFee CountryFee percent7.2;
set WORK.REALESTAT;
LocalFee=LocalFee/100;
CountryFee=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 percent7.2
C. Both LocalFee and CountryFee have a format of percent7.2
D. The data step fails execution; there is no format for LocalFee.

Check Answer
Answer: C

注解:FORMAT statement可以一次改变多个变量的format。此外,假设原始值是10,那么Format改成percent7.2之后,输出的结果则为1000%。

SAS Base (11)

The following SAS program is submitted:

data course;
input exam;
datalines;
50.1
;
run;

proc format;
value score 1 – 50 = ‘Fail’
51 – 100 = ‘Pass’;
run;

proc report data =course nowd;
column exam;
define exam / display format=score.;
run;

What is the value for exam?
A. Fail
B. Pass
C. 50.1
D. No output

Check Answer
Answer: C

注解:自定义format Score只定义了1至50、51至100这两个区间,50.1并不在这两个区间之内,所以输出的时候依然显示50.1。