58.The following program is submitted:
proc format;
value salfmt.
0 -< 50000 = \’Less than 50K\’
50000 – high = \’50K or Greater\';
options fmterr nodate pageno=1;
title \’Employee Report\';
proc print data=work.employees noobs;
var fullname salary hiredate;
format
salary salfmt.
hiredate date9.;
label
fullname=\’Name of Employee\’
salary=\’Annual Salary\’
hiredate=\’Date of Hire\';
run;
Why does the program fail?
A. The PAGENO option is invalid in the OPTIONS statement.
B. The RUN statement is missing after the FORMAT procedure.
C. The format name contains a period in the VALUE statement.
D. The LABEL option is missing from the PROC PRINT statement.
Answer: C
错误就在PROC FORMAT语句中,value的命名salfmt. 不应搞包括DOT(.)。
这个点号是SAS用来区别一个变量名以及一个format格式名称的差别。
看看英文一个说明:
The period (or “dot”) in the Format
distinguishes it from a Variable Name. When SAS “sees” the “dot,” it “knows” to associate the instructions in the given Format to the Variable. Since SAS Variable Names can only contain letters, numbers and the underscore
symbol, the period symbol is how SAS detects the difference between a Variable and a Format.
Why the proc print has no 'label' function but that was notwrong, why not D?