|
|
楼主

楼主 |
发表于 2010-11-10 23:04:17
|
只看该作者
跟crakman做sas base认证试题(3)
From crackman's blog on Baidu
<p><font size="4">3.The Excel workbook REGIONS.XLS contains the following four worksheets:<br>
EAST<br>
WEST<br>
NORTH <br>
SOUTH <br>
<br>
The following program is submitted:<br>
<br>
libname MYXLS 'regions.xls'; <br>
<br>
Which PROC PRINT step correctly displays the NORTH worksheet? <br>
A. proc print data=MYXLS.NORTH;run; <br>
B. proc print data=MYXLS.NORTH$;run; <br>
C. proc print data=MYXLS.'NORTH'e;run; <br>
D. proc print data=MYXLS.'NORTH$'n;run; <br>
<br>
Answer: D<br>
其实这道题考察的是SAS读取非SAS数据源。<br>
看看答案,四个答案里面差异在于符号$以及E和N的差别。</font></p>
<p><font size="4">以下是SAS PAPER里面的解释:<br>
我觉得最关键的就是SAS LIBNAME建立的是以XLS为数据源的逻辑库时,创建了两个数据源,一个是spreadsheet 另外一个是 named range(指定范围的数据)。<br>
我们在输出整个数据时候,应该是spreadsheet,而不是相对指定的范围的数据。制定范围的数据,其实熟悉EXCEL应该知道,就是我们选择部分数据作为我们要分析的对象,用<br>
鼠标拖动即可产生制定范围的数据。<br>
Looking at SAS Explorer it may be surprising that each dataset written to<br>
Excel appears twice, once with the expected name and once with a trailing<br>
“$”.<br>
Unlike a typical data source, data in an Excel spreadsheet need not be left<br>
and top aligned. For this Excel has named ranges which allow data to be<br>
placed anywhere inside a spreadsheet. By default SAS reads and writes<br>
data from named ranges on spreadsheets, but will also read spreadsheet<br>
data directly in the absence of a named range.<br>
When a new SAS dataset is created in an Excel library, SAS creates both a<br>
spreadsheet and a named range. Each is given the same name, with the<br>
spreadsheet denoted by a trailing “$”.<br>
In the example at right CLASS is the named range created by the Excel<br>
engine and CLASS$ is the spreadsheet created by the Excel engine to hold<br>
the named range. Within SAS, the named range is referred to as<br>
Wrkbk.CLASS, and the spreadsheet is referenced using the name literal<br>
Wrkbk.’CLASS$’n.<br>
SAS name literals are name tokens written as strings within quotation<br>
marks, followed by the letter n. Name literals allow the use of special<br>
characters that are not otherwise allowed in SAS names , like the “$” used by<br>
the Excel libname engine to distinguish worksheets from named ranges. For<br>
more information see the Recommended Readings.</font></p> <a href="http://hi.baidu.com/crack%5Fman/blog/item/68a5fada3e4dce4495ee37af.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> <a href="http://hi.baidu.com/crack%5Fman/blog/item/68a5fada3e4dce4495ee37af.html#comment">查看评论</a> |
|