全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1485 3
2015-02-25

93. This question will ask you to provide a line of missing code.
Given the following data set WORK.SALES:
SalesID SalesJan FebSales MarchAmt
------- -------- -------- --------
W6790 50 400 350
W7693 25 100 125
W1387 . 300 250
The following SAS program is submitted:
data WORK.QTR1;
set WORK.SALES;
array month{3} SalesJan FebSales MarchAmt;
<insert code here>
run;
Which statement should be inserted to produce the following output?
SalesID SalesJan FebSales MarchAmt Qtr1
------- -------- -------- -------- ----
W6790 50 400 350 800
W7693 25 100 125  250
W1387 . 300 250 550
A.Qtr1 = sum(of month{_ALL_});
B. Qtr1 = month{1} + month{2} + month{3};
C. Qtr1 = sum(of month{*});
D.Qtr1 = sum(of month{3});
Answer: C

请问下大家,为什么用C不用D? 我选的D。
谢谢大家!
二维码

扫码加我 拉你入群

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

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

全部回复
2015-2-27 00:04:56
outside of ARRAY statement, month{3} is temp var which always refers to the 3rd var (i.e. "MarchAmt" here). So, D is not right answer.
二维码

扫码加我 拉你入群

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

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

2015-2-27 09:08:54
goldbaodi 发表于 2015-2-27 00:04
outside of ARRAY statement, month{3} is temp var which always refers to the 3rd var (i.e. "MarchAmt" ...
谢谢!明白了!
二维码

扫码加我 拉你入群

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

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

2018-3-17 20:52:18
求问,为什么A选项不对呢?
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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