土豆泥
The following SAS DATA step is submitted:
data sasdata.atlanta
sasdata.boston
work.portland
work.phoenix;
set company.prdsales;
if region = 'NE' then output boston;
if region = 'SE' then output atlanta;
if region = 'SW' then output phoenix;
if region = 'NW' then output portland;
run;
Which one of the following is true regarding the output data sets?
A. No library references are required.
B. The data sets listed on all the IF statements require a library reference.
C. The data sets listed in the last two IF statements require a library
reference.
D. The data sets listed in the first two IF statements require a library
reference.
Answer: D
这道题没有看懂,能不能提示一下考的哪个知识点吗?谢谢
tomquercio
[quote]引用第0楼土豆泥于2008-08-02 11:34发表的“SAS考试的一道练习题”:
The following SAS DATA step is submitted:
data sasdata.atlanta
sasdata.boston
work.portland
work.phoenix;
.......[/quote]
请楼主注意开头的语句
data sasdata.atlanta
sasdata.boston
work.portland
work.phoenix;
说明了这四个数据集所处的不同的library
头两个if语句的output数据集boston atlanta都是在library sasdata下的 而后两个if语句的output数据集都是默认的系统工作library 当然也就不需要library reference了
土豆泥
[quote]引用第1楼tomquercio于2008-08-03 00:55发表的“”:
请楼主注意开头的语句
data sasdata.atlanta
sasdata.boston
.......[/quote]
不好意思,我还是不明白,如果没有libname这个语句这个程序就不能运行了? 到底这个libname起到啥作用呢?
tomquercio
[quote]引用第2楼土豆泥于2008-08-03 07:33发表的“”:
不好意思,我还是不明白,如果没有libname这个语句这个程序就不能运行了? 到底这个libname起到啥作用呢?[/quote]
不是不能运行了,现在是程序的意思是想把头两个dataset存储到sasdata下面,后两个dataset存储到默认的工作路径work下面,默认的工作路径是不需要特别声明的,而头两个要存储的sasdata不是默认的,所以需要引用library
250704207
hexm26
正确的程序应该是
data sasdata.atlanta
sasdata.boston
work.portland
work.phoenix;
set company.prdsales;
if region = 'NE' then output sasdata.boston;
if region = 'SE' then output sasdata.atlanta;
if region = 'SW' then output phoenix;
if region = 'NW' then output portland;
run;
而work.portland等同于portland,因为work是SAS默认的临时工作Library,关上SAS就自动没有了。sasdata由你自定义,可以存在硬盘的其他什么地方。
雪隼
临时库与永久库的区别
jlq010
SAS考试这么简单啊