楼主: Hollycherry
1516 5

[原创博文] base 70 题 最后一题 [推广有奖]

  • 1关注
  • 1粉丝

讲师

77%

还不是VIP/贵宾

-

威望
0
论坛币
91 个
通用积分
0.0498
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
85040 点
帖子
98
精华
0
在线时间
1072 小时
注册时间
2011-1-12
最后登录
2025-3-8

楼主
Hollycherry 发表于 2011-7-15 05:25:28 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
原题如下:我不懂为啥答案是D,能否解释一下, 谢谢
70.After a SAS program is submitted, the following is written to the SAS log:

  105    data WORK.JANUARY;
  106    set WORK.ALLYEAR(keep=Product Month Quantity Cost);
  107    if Month=’JAN’ then output WORK.JANUARY;
  108    Sales=Cost * Quantity;
  109    drop=Month Quantity Cost;
                      —–
                      22
  ERROR 22-322: Syntax error, expecting one of the following: !,
                !!, &, *, **, +, -,
  , <=, <>, =, >, >=,
                AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL,
                NOTIN, OR, ^=, |, ||, ~=.
  110  run;

What data set option could be attached to WORK.JANUARY to replace the DROP statement that generated the error in the log?
     A. (drop Month  Quantity  Cost)
     B. (drop Month, Quantity, Cost)
     C. (drop=Month, Quantity, Cost)
     D. (drop=Month  Quantity  Cost)
Answer: D
我运行了一段相似的代码, 显示drop statement有误,
391 data work.january;
392 set sasuser.sales (keep=lastname month Residential Commercial);
393 if month='JAN' then output work.january;
394 sales=Residential+Commercial;
395 (drop=residential commercial);
-
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
396 format sales dollar12.2;
397 run;
二维码

扫码加我 拉你入群

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

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

关键词:Base Residential Commercial statement following following written error ERROR

沙发
caiteha 发表于 2011-7-15 05:50:43
他是想这样的把drop放在开头:
data WORK.JANUARY (drop=Month  Quantity  Cost);
而不是在最后

我也在学base,哈哈

藤椅
pobel 在职认证  发表于 2011-7-15 07:13:35
Drop= 和 keep= 属于data set option, 应该放在数据集名字后面的括号里。



data class(Keep=name weight);
       set sashelp.class;
run;

data class(drop=age sex height);
      set sashelp.class;
run;

Drop 和 keep 语句要作为data step中独立的一句,后面不能跟等号。

data class;
      set sashelp.class;
     keep name weight;
run;

data class;
    set sashelp.class;
   drop age sex height;
run;
和谐拯救危机

板凳
Hollycherry 发表于 2011-7-15 08:24:41
谢谢回复
根据line 109  in the SAS log ,
此题的答案应是
drop Month  Quantity  Cost;
无括号和等号, 原题是不是没有答案?

报纸
Hollycherry 发表于 2011-7-15 08:28:07
看懂原题了,答案是D

地板
baoaibaobao 发表于 2011-7-15 09:47:41
data set option--------------->(drop=Month  Quantity  Cost)
DROP statement------------>drop Month  Quantity  Cost

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

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