楼主: hwyale
1549 1

[问答] sas base 70/58 HELP [推广有奖]

  • 0关注
  • 0粉丝

本科生

40%

还不是VIP/贵宾

-

威望
0
论坛币
705 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
445 点
帖子
41
精华
0
在线时间
103 小时
注册时间
2014-10-30
最后登录
2017-1-12

楼主
hwyale 发表于 2015-3-20 11:05:04 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

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?


二维码

扫码加我 拉你入群

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

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

关键词:SAS base Base Help elp distinguish following title

沙发
seven74 发表于 2015-3-21 05:28:49
不写label是不能显示label了,但是不是syntex error呀,不会导致程序fail,只是结果中的名字都是variablle name
已有 2 人评分论坛币 学术水平 热心指数 收起 理由
xncdww + 1 + 1 观点有启发
admin_kefu + 20 热心帮助其他会员

总评分: 论坛币 + 20  学术水平 + 1  热心指数 + 1   查看全部评分

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-8 01:40