请选择 进入手机版 | 继续访问电脑版
楼主: picassososo
3341 6

[原创博文] 几个SAS base问题求讨论 [推广有奖]

  • 0关注
  • 0粉丝

学前班

20%

还不是VIP/贵宾

-

威望
0
论坛币
2 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
23 点
帖子
2
精华
0
在线时间
0 小时
注册时间
2009-9-12
最后登录
2010-1-7

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
1.Which statement is true concerning the SAS automatic variable _ERROR_?

A.It cannot be used in an if/then condition.


B.It cannot be used in an assignment statement.


C.It can be put into a keep statement or keep= option.


D.It is automatically dropped.


(选D??)



2.The following SAS program is sumbitted:


data WORK.INFO;


infile 'DATAFILE.TXT';


input @1 Company $20. @25 State $2. @;


if State=' ' then input @30 Year;


else input @30 City Year;


input NumEmployees;


run;


How many raw data records are read during each iteration of the DATA step?


A.1          B.2          C.3           D.4




3.You're attempting to read a raw data file and you see the following messages displayed in the SAS Log:


NOTE: Invalid data for Salary in line 4 15-23.



RULE:
----+----1----+----2----+----3----+----4----+----5--


4 120104 F 46#30 11MAY1954 33


Employee_Id=120104 employee_gender=F Salary=. birth_date=-2061 _ERROR_=1 _N_=4


NOTE: 20 records were read from the infile 'c:\employees.dat'.


The minimum record length was 33.


The maximum record length was 33.


NOTE: The data set WORK.EMPLOYEES has 20 observations and 4 variables.


What does it mean?


A.A compiler error, triggered by an invalid character for the variable Salary.


B.An execution error, triggered by an invalid character for the variable Salary.


C.The 1st of potentially many errors, this one occurring on the 4th observation.


D.An error on the INPUT statement specification for reading the variable Salary.


(我觉得是B)



4.Consider the following data step:


data WORK.NEW;


set WORK.OLD;


Count+1;


run;


The variable Count is created using a sum statement. Whichstatement regarding this variable is true?


A.It is assigned a value 0 when the data step begins execution.


B.It is assigned a value of missing when the data step begins execution.


C.It is assigned a value 0 at compile time.


D.It is assigned a value of missing at compile time.


(我选A)




5.A user-defined format has been created using the FORMAT procedure.


How is it stored?


A.in a SAS catalog


B.in a memory resident lookup table


C.in a SAS dataset in the WORK library


D.in a SAS dataset in a permanent SAS data library





二维码

扫码加我 拉你入群

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

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

关键词:SAS base Base observations observation concerning concerning following cannot option ERROR

回帖推荐

星落荒原 发表于6楼  查看完整内容

我觉得答案是:DBBCA 第二题由于input @1 Company 20.@25State2. @; if State=' ' then input @30 Year; else input @30 City Year; 没有@ 所以之后input读新的一行 input NumEmployees; 读新的一行 总共读了2行raw data 第三题 此处为data error选B 第四题 Count+1; 等价于 retain count 0,所以一开始count=0 所以选C 第五题 new format 存在 in a SAS catalog :WORK.FORMATS or SASUSER.FORMATS catalog 所以选A

本帖被以下文库推荐

bobguy 发表于 2010-1-7 07:28:49 |显示全部楼层 |坛友微信交流群
1# picassososo

All of them are simple questions and one can find the answer in SAS/BASE manual.

Or one can run the program or one can write a short program to see what is going on.

In this way, you will accumulate your SAS knowledge.

使用道具

joskow 发表于 2010-1-7 15:18:26 |显示全部楼层 |坛友微信交流群
同问答案。

使用道具

bullstag 发表于 2010-1-7 17:10:05 |显示全部楼层 |坛友微信交流群
D A B A A 吧
最后一题不确定,不过BCD肯定都不对,所以选A。
楼主如果想准备base考试的话,可以PM我个联系方式,我们可以讨论讨论,我也在准备。

使用道具

wb8686 发表于 2010-1-13 22:10:53 |显示全部楼层 |坛友微信交流群
不对,答案是DBACA,我后天考!!

使用道具

星落荒原 发表于 2014-12-16 07:30:14 |显示全部楼层 |坛友微信交流群
我觉得答案是:DBBCA
第二题由于input @1 Company 20.@25State2. @;

if State=' ' then input @30 Year;

else input @30 City Year; 没有@ 所以之后input读新的一行

input NumEmployees;  读新的一行 总共读了2行raw data
第三题 此处为data error选B
第四题 Count+1; 等价于 retain count 0,所以一开始count=0 所以选C
第五题 new format 存在 in a SAS catalog :WORK.FORMATS or SASUSER.FORMATS catalog 所以选A
已有 2 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子
admin_kefu + 30 热心帮助其他会员

总评分: 经验 + 3  论坛币 + 33   查看全部评分

使用道具

分不太清 Compile time 和execution. 以及数据读入的过程是属于execution吗?

使用道具

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

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

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

GMT+8, 2024-4-16 22:15