全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1517 1
2015-03-20

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?


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-3-21 05:28:49
不写label是不能显示label了,但是不是syntex error呀,不会导致程序fail,只是结果中的名字都是variablle name
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群