标题: 跟crakman做sas base认证试题(58) [打印本页] 作者: shiyiming 时间: 2010-11-13 15:39 标题: 跟crakman做sas base认证试题(58) From crackman's blog on Baidu
<p><font size="4" face="宋体">58.The following program is submitted:<br>
<br>
proc format; <br>
value salfmt. <br>
0 -< 50000 = 'Less than 50K'<br>
50000 - high = '50K or Greater'; <br>
<br>
options fmterr nodate pageno=1;<br>
title 'Employee Report'; <br>
<br>
proc print data=work.employees noobs;<br>
var fullname salary hiredate; <br>
format<br>
salary salfmt. <br>
hiredate date9.;<br>
label <br>
fullname='Name of Employee'<br>
salary='Annual Salary' <br>
hiredate='Date of Hire';<br>
run;<br>
<br>
Why does the program fail?</font></p>
<p><font size="4" face="宋体"> A. The PAGENO option is invalid in the OPTIONS statement.<br>
B. The RUN statement is missing after the FORMAT procedure. <br>
C. The format name contains a period in the VALUE statement.<br>
D. The LABEL option is missing from the PROC PRINT statement.</font></p>
<p><font size="4" face="宋体">Answer: C</font></p>
<p><font size="4" face="宋体">错误就在PROC FORMAT语句中,value的命名salfmt. 不应搞包括DOT(.)。<br>
这个点号是SAS用来区别一个变量名以及一个format格式名称的差别。<br>
看看英文一个说明:<br>
The period (or “dot”) in the Format<br>
distinguishes it from a Variable Name. When SAS “sees” the “dot,” it “knows” to associate the instructions in </font><font size="4" face="宋体">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</font></p> <a href="http://hi.baidu.com/crack%5Fman/blog/item/750f4a127e2d105a21a4e97c.html">阅读全文</a>