SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 1582|回复: 0
打印 上一主题 下一主题

跟crakman做sas base认证试题(58)

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2010-11-13 15:39:45 | 只看该作者

跟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>
&nbsp;&nbsp;&nbsp;&nbsp;  value salfmt. <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  0 -&lt; 50000&nbsp;&nbsp;  = 'Less than 50K'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  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>
&nbsp;&nbsp;&nbsp;&nbsp;  var fullname salary hiredate; <br>
&nbsp;&nbsp;&nbsp;&nbsp;  format<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  salary salfmt. <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  hiredate date9.;<br>
&nbsp;&nbsp;&nbsp;&nbsp;  label <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  fullname='Name of Employee'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  salary='Annual Salary' <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  hiredate='Date of Hire';<br>
  run;<br>
<br>
Why does the program fail?</font></p>
<p><font size="4" face="宋体">&nbsp;&nbsp;&nbsp;&nbsp;  A. The PAGENO option is invalid in the OPTIONS statement.<br>
&nbsp;&nbsp;&nbsp;&nbsp;  B. The RUN statement is missing after the FORMAT procedure. <br>
&nbsp;&nbsp;&nbsp;&nbsp;  C. The format name contains a period in the VALUE statement.<br>
&nbsp;&nbsp;&nbsp;&nbsp;  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 &ldquo;dot&rdquo;) in the Format<br>
distinguishes it from a Variable Name. When SAS &ldquo;sees&rdquo; the &ldquo;dot,&rdquo; it &ldquo;knows&rdquo; 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>
               
                <br/><b>类别:</b><a href="http://hi.baidu.com/crack%5Fman/blog/category/%B8%FAcrackman%D7%F6sas%20base%C8%CF%D6%A4%CA%D4%CC%E2">跟crackman做sas base认证试题</a>&nbsp;<a href="http://hi.baidu.com/crack%5Fman/blog/item/750f4a127e2d105a21a4e97c.html#comment">查看评论</a>
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2026-2-3 14:51 , Processed in 0.179959 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表