SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 2347|回复: 7
打印 上一主题 下一主题

SAS advance exam question 5: Data step

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2010-6-10 23:13:37 | 只看该作者

SAS advance exam question 5: Data step

The following SAS code is submitted:

data WORK.TEMP WORK.ERRORS / view=WORK.TEMP;
infile RAWDATA;
input Xa Xb Xc;
if Xa=. then output WORK.ERRORS;
else output WORK.TEMP;
run;

Which of the following is true of the WORK.ERRORS data set?
A. The data set is created when the DATA step is submitted.
B. The data set is created when the view TEMP is used in another SAS step.
C. The data set is not created because the DATA statement contains a syntax error.
D. The descriptor portion of WORK.ERRORS is created when the DATA step is submitted.

Why the correct answer is  C? Thanks in advance.

^_^
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
沙发
 楼主| 发表于 2010-6-11 10:18:52 | 只看该作者

Re: SAS advance exam question 5: Data step

Unfortunately C is not the right answer. Remember that when you submit the code, a pre-compiled data step is created but not executed.
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
板凳
 楼主| 发表于 2010-6-12 04:34:16 | 只看该作者

Re: SAS advance exam question 5: Data step

After review the Data Step Processing, I choose D as the answer.

DATA step is consisted of two phase: compilation phase and execution phase.

^_^
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
地板
 楼主| 发表于 2010-6-12 09:12:35 | 只看该作者

Re: SAS advance exam question 5: Data step

B seems to be the most appropriate one.
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
5#
 楼主| 发表于 2010-6-13 08:26:22 | 只看该作者

Re: SAS advance exam question 5: Data step

Would you please give me more details about the reasons why B should be the most appropriate answer?
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
6#
 楼主| 发表于 2010-6-13 19:32:10 | 只看该作者

Re: SAS advance exam question 5: Data step

1. If RAWDATA exists, there is no syntax error.
2. After a data step view is submitted a view is created.
data _test_ _out_ /view=_test_;
    x=1;
run;

proc datasets lib=work nolist;
        contents data=_all_ nods;
run;
3. After the view is called the data set _out_ is created.
data _null_;
    set _test_;
run;

proc datasets lib=work nolist;
        contents data=_all_ nods;
run;
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
7#
 楼主| 发表于 2010-6-24 12:17:02 | 只看该作者

Re: SAS advance exam question 5: Data step

Thanks!

--
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
8#
 楼主| 发表于 2012-7-11 16:00:37 | 只看该作者

Re: SAS advance exam question 5: Data step

[quote="ergoudan":1l1gn31p]1. If RAWDATA exists, there is no syntax error.
2. After a data step view is submitted a view is created.
data _test_ _out_ /view=_test_;
    x=1;
run;

proc datasets lib=work nolist;
        contents data=_all_ nods;
run;
3. After the view is called the data set _out_ is created.
data _null_;
    set _test_;
run;

proc datasets lib=work nolist;
        contents data=_all_ nods;
run;[/quote:1l1gn31p]
解释得很好啊!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-9 01:41 , Processed in 0.096238 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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