SAS中文论坛

标题: 跟crakman做sas base认证试题(49) [打印本页]

作者: shiyiming    时间: 2010-11-13 00:31
标题: 跟crakman做sas base认证试题(49)
From crackman's blog on Baidu


               
                <p><font size="4">49.The following SAS program is submitted:<br>
<br>
  data WORK.TOTALSALES(keep=MonthSales{12}); <br>
&nbsp;&nbsp;&nbsp;&nbsp;  set WORK.MONTHLYSALES(keep=Year Product Sales); <br>
&nbsp;&nbsp;&nbsp;&nbsp;  array MonthSales{12}; <br>
&nbsp;&nbsp;&nbsp;&nbsp;  do i=1 to 12; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  MonthSales{i}=Sales;<br>
&nbsp;&nbsp;&nbsp;&nbsp;  end;<br>
&nbsp;&nbsp;&nbsp;&nbsp;  drop i;<br>
  run;<br>
<br>
The program fails execution due to syntax errors.<br>
What is the cause of the syntax error? <br>
&nbsp;&nbsp;&nbsp;&nbsp;  A. An array cannot be referenced on a keep= data set option.<br>
&nbsp;&nbsp;&nbsp;&nbsp;  B. The keep= data set option should be (keep=MonthSales*). <br>
&nbsp;&nbsp;&nbsp;&nbsp;  C. The keep= data set option should be the statement KEEP MonthSales{12}.<br>
&nbsp;&nbsp;&nbsp;&nbsp;  D. The variable MonthSales does not exist.<br>
<br>
Answer:A</font></p>
<p><font size="4">本题考察的是数组以及KEEP语句。<br>
KEEP语句中必须是具体变量,不能是数组。<br>
另外数组MonthSales{12},并没有说明这个数组内部的成员名称。通过下标来引用数组成员的。</font></p> <a href="http://hi.baidu.com/crack%5Fman/blog/item/cb239827dbe6f854ac34de20.html">阅读全文</a>
               
                <br/><b>类别:</b><a href="http://hi.baidu.com/crack%5Fman/blog/category/%B8%FAcrackman%D7%F6sas%20base%C8%CF%D6%A4%CA%D4%CC%E2">跟crackman做sas base认证试题</a>&nbsp;<a href="http://hi.baidu.com/crack%5Fman/blog/item/cb239827dbe6f854ac34de20.html#comment">查看评论</a>




欢迎光临 SAS中文论坛 (https://mysas.net/forum/) Powered by Discuz! X3.2