全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3188 3
2008-08-22
117. The following SAS program is submitted:
data work.totalsales (keep = monthsales{12} );
set work.monthlysales (keep = year product sales);
array monthsales {12} ;
do i=1 to 12;
monthsales{i} = sales;
end;
run;
The data set named WORK.MONTHLYSALES has one observation per month
for each of five years for a total of 60 observations.
Which one of the following is the result of the above program?
A00-211
- 36 - http://www.ePlanetLabs.com
A. The program fails execution due to data errors.
B. The program fails execution due to syntax errors.
C. The program executes with warnings and creates the WORK.TOTALSALES
data set.
D. The program executes without errors or warnings and creates the
WORK.TOTALSALES data set.
Answer: B
为何选b 呢?
二维码

扫码加我 拉你入群

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

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

全部回复
2008-8-22 22:44:00

keep = monthsales{12}

这一句有问题,如果想要引用数组中的变量,要用 monthsales1-monthsales12,而不是monthsales{12}。当然假如不是12,是1或者2 的话,那选择A就是正确的了,但很显然程序中数据是没有问题的,只是语法不对。

二维码

扫码加我 拉你入群

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

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

2008-8-23 01:59:00
是不是可以这样理解:monthsales{12}是array name,然而monthsales1-12是variables name?
二维码

扫码加我 拉你入群

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

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

2008-8-23 07:34:00
可以,[em01]
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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