SAS Base (45)

The following SAS program is submitted:

ods csvall file=’c:test.csv’;
proc print data=WORK.ONE;
var Name Score Grade;
by IdNumber;
run;
ods csvall close;

What is produced as output?

A. A file named test.csv that can only be opened in Excel.
B. A text file named test.csv that can be opened in Excel or in any text editor.
C. A text file named test.csv that can only be opened in a text editor.
D. A file named test.csv that can only be opened by SAS.

Check Answer
Answer: B

注解:ODS,全称Output Delivery System,用于导出SAS中数据和分析结果。开启ODS格式:
ODS destination file = ‘想要保存文件的路径+文件名.扩展名’;
关闭ODS格式:
ODS destination CLOSE;
其中destination用于定义导出文件的类型,比如题目中的CSVALL、HTML、PDF等。本题的程序输出的是CSV文件,可以用Excel和任意本文编辑器打开。

SAS Base (7)

Which of the following choices is an unacceptable ODS destination for producing output that can be viewed in Microsoft Excel?

A. MSOFFICE2K
B. EXCELXP
C. CSVALL
D. WINXP

Check Answer
Answer: D

注解:MSOFFICE2K用于生成XLS文件,EXCELXP生成XML文件,CSVALL生成CSV文件,以上三种都可以用Excel打开。最后,不存在WINXP这种ODS destination。