楼主: hailingkatherin
1049 1

关于drop的问题 [推广有奖]

  • 0关注
  • 0粉丝

已卖:13份资源

硕士生

82%

还不是VIP/贵宾

-

威望
0
论坛币
277 个
通用积分
0
学术水平
1 点
热心指数
5 点
信用等级
1 点
经验
164 点
帖子
126
精华
0
在线时间
87 小时
注册时间
2015-1-18
最后登录
2016-5-15

楼主
hailingkatherin 发表于 2015-2-17 09:53:52 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
The SAS data sets Work.Employee and Work.Salary are shown below.
Work.Employee
fna me age
Bruce 30
Dan 40
Work.Salary
fname salary
Bruce 25000
Bruce 35000
Dan 25000
The following merged SAS data set is generated:
Work.Empdata
fname age totsal
Bruce 30 60000
Dan 40 25000
Which one of the following SAS programs created the merged data set?


b. data work.empdata(drop=salary);
merge work.employee
work.salary;
by fname;

if first.fname then totsal=0;
totsal+salary;
if last.fname then output;
run;
c. data work.empdata;
merge work.employee
work.salary(drop=salary);
by fname;
if first.fname then total=0;
totsal+salary;
if last.fname then output;
run;
为什么B对?我认为C对啊?drop这里到底应该写在哪里呢?

二维码

扫码加我 拉你入群

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

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

关键词:drop following generated Employee programs generated following programs created

沙发
琉夜 发表于 2015-2-17 15:29:50
如果选c的话,work.salary中的salary变量不读入,那就无法计算total变量,所以很明显C 不对。而merge后的data set :Work.Empdata中不含salary这个变量,所以drop应该放在Work.Empdata后面。

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-22 10:47