SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 1199|回复: 0
打印 上一主题 下一主题

跟crakman做sas base认证试题(3)

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 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>
&nbsp;&nbsp;&nbsp;&nbsp;  EAST<br>
&nbsp;&nbsp;&nbsp;&nbsp;  WEST<br>
&nbsp;&nbsp;&nbsp;&nbsp;  NORTH <br>
&nbsp;&nbsp;&nbsp;&nbsp;  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>
&nbsp;&nbsp;&nbsp;&nbsp;  A. proc print data=MYXLS.NORTH;run; <br>
&nbsp;&nbsp;&nbsp;&nbsp;  B. proc print data=MYXLS.NORTH$;run; <br>
&nbsp;&nbsp;&nbsp;&nbsp;  C. proc print data=MYXLS.'NORTH'e;run; <br>
&nbsp;&nbsp;&nbsp;&nbsp;  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>
&ldquo;$&rdquo;.<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 &ldquo;$&rdquo;.<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.&rsquo;CLASS$&rsquo;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 &ldquo;$&rdquo; 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>&nbsp;<a href="http://hi.baidu.com/crack%5Fman/blog/item/68a5fada3e4dce4495ee37af.html#comment">查看评论</a>
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2026-2-3 18:30 , Processed in 0.067665 second(s), 22 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表