楼主: Tenkahitori
7379 9

[问答] 3道BASE题目 求高手解惑 [推广有奖]

  • 1关注
  • 1粉丝

本科生

2%

还不是VIP/贵宾

-

威望
0
论坛币
179 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
571 点
帖子
69
精华
0
在线时间
50 小时
注册时间
2009-3-9
最后登录
2022-1-14

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

45.The following SAS program is submitted:


  ods csvallfile='c:\test.cvs';

  proc printdata=WORK.ONE;

     var Name ScoreGrade;

     by IdNumber;

  run;

  ods csvall close;


What is produced as output?


     A. A file named test.cvs thatcan only be opened in Excel.

     B. A text file named test.cvsthat can be opened in Excel or in any text editor.

     C. A text filenamed test.cvs that can only be opened in a text editor.

     D. A file named test.cvs thatcan only be opened by SAS.


Answer: C

问题: 1.)哪里有详细的ODS destination 的介绍? 我看的是base prep guide 寥寥数语就带过了。

2.)另外 我敢打包票excel绝对能够打开CVS, 用import wizard 100%能打开!


3.换用excel 能打开的ods, 切text editor 能打开的ODS是什么?



48.The following SAS program is submitted:   

data WORK.TEST;     

drop City;   

infile datalines;     

input         

Name $ 1-14 /        

Address $ 1-14 /        

City $ 1-12 ;     

if City='New York  ' then input @1 State $2.;     

else input;   

datalines;   

Joe Conley   

123 Main St.  

Janesville   

WI  

Jane Ngyuen  

555 Alpha Ave.   

New York   

NY  

Jennifer Jason   

666 Mt. Diablo   

Eureka  

CA  ;

What will the data set WORK.TEST contain?         

A. Name              Address            State

--------------   ----------------   ------

Joe Conley        123 Main St.

Jane Ngyuen       555 AlphaAve.   

NYJennifer Jason    666 Mt. Diablo      

B. Name              Address           City         State

--------------   ----------------  -----------  ------

Joe Conley        123 Main St.      Janesville

Jane Ngyuen       555 AlphaAve.    New York     NY

Jennifer Jason    666 Mt.Diablo    Eureka      

C.

Name              Address            State

--------------   ----------------   ------

Jane Ngyuen       555 AlphaAve.     NY      

D. O observations,there is asyntax error in the data step. correct Answer:

A这道题为什么不选B?city为什么不输出???

还有最末的else input; 到底是什么意思


53.The following SAS program is submitted:   

data WORK.TOTAL_SALARY;     

retain Total;      

set WORK.SALARY;     

by Department;   

if First.Department        then Total=0;     

Total=sum(Total, Wagerate);   

if Last.Total;  

run; 正确答案说是total 的initial value=missing.但是retain 在没有argument 的情况下, 不应该是 retain either input or assignment 的value, from one data step to next 吗?至少也应该能够从读取的数据库里面保留下来吧
另外retain 没有argument, retain 的variable 没有被created, 那么retain 也应该赋值0给这个variable啊?
所以我选了D, cannot be determined from the information given.
感谢各位老大!
谢谢!


二维码

扫码加我 拉你入群

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

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

关键词:Base 求高手 observations destination information only following produced opened close

沙发
ywb0314 发表于 2011-11-14 14:55:52 |只看作者 |坛友微信交流群
第一题中的'c:\test.cvs'; 是不是写错了,应为'c:\test.csv',但是错的好像也能打开,我试了word excel  windows自带写字板 记事本都可以打开。第二题我运行之后发现address和name是一样的,希望有谁能解释下为什么。第三题貌似if Last.Total; 应该写作if Last.Department;

使用道具

藤椅
Tenkahitori 发表于 2011-11-14 16:44:16 |只看作者 |坛友微信交流群
第一题csv cvs都可以的 我想这个不应该是主要问题。
第二题 运行正常 结果是选A
第三题 计算subtotal for department, 但是只输出一个结果, 即最后的total. 因为是sum.
第三题的问题是 total的initial value A=0 B=missing D=uncertain

使用道具

板凳
Tenkahitori 发表于 2011-11-15 11:42:58 |只看作者 |坛友微信交流群
第三题已经解决, retain statement according sas base prep guide chap 11 initialise the variable to missing, if no argument is specified.

残念!

求高手解答第一题 第二题 勿以善小而不为啊!

使用道具

报纸
knight小璐 发表于 2011-11-17 10:18:10 |只看作者 |坛友微信交流群
第二题你在city后面加一个@,看看还有city么
或者你在state变成@10,看看

使用道具

地板
栾昭昭 发表于 2011-11-17 11:42:08 |只看作者 |坛友微信交流群
我运行了一下第二个,只有Address,Name和state下都是空的,Why?求解译...
one apple one day

使用道具

7
steviori 发表于 2011-11-17 13:35:17 |只看作者 |坛友微信交流群
答案仅供参考,我当时99%通过的BASE,应该只错了一道题,希望不是这三道中的一道....,祝好运:

第一题 45/70:CSV是comma separated values的缩写。这段SAS程序其实就是创建了一个.csv文件。这种.csv文件是可以用text editor打开的。用Excel2007和2010是可以打开的。建议选B。具体关于csv格式文件你可以wiki一下。

第二题 48/70:请注意程序的第二行"drop city",这条语句的目的就是把city这个变量给drop掉。

else input;的意思可以联系前面的if then语句来理解:if 城市是纽约 then State = NY; else (也就是说如果城市不是纽约) input (nothing); 换句话说,当城市不是纽约的时候:相应观测条目的State变量的值为“空白"。

另外这到底应该注意pointer的在行间的变化,理解了pointer的变化对以后很多工作都挺有意义的,除非你转去java.

第三题 53/70:详细在这里:http://support.sas.com/documenta ... .htm#a000214163.htm

        If you omit initial-value, the initial value is missing. Initial-value is assigned to all the elements that precede it in the list. All members of a variable list, therefore, are given the same initial value.

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
Tenkahitori + 1 + 1 + 1 热心帮助其他会员

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

使用道具

8
ordinaryxing 发表于 2011-11-18 04:01:36 |只看作者 |坛友微信交流群
只是飘过

使用道具

9
Tenkahitori 发表于 2011-11-18 13:44:37 |只看作者 |坛友微信交流群
真是感谢steviori!!!! 已经评分了!

明了了...下一步准备转R或者matlab, 还是准备回C++/

使用道具

10
suzhzh 发表于 2011-11-21 22:05:51 |只看作者 |坛友微信交流群
学习了,真的很好,问题不错。

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-1 21:53