SAS Base (23)

Which is a valid LIBNAME statement?
A. libname “_SAS_data_library_location_”;
B. sasdata libname “_SAS_data_library_location_”;
C. libname sasdata “_SAS_data_library_location_”;
D. libname sasdata sas “_SAS_data_library_location_”;

Check Answer
Answer: C

注解:正确格式为:LIBNAME  libref  ‘文件路径’。

SAS Base (12)

The Excel workbook QTR1.XLS contains the following three worksheets:
JAN
FEB
MAR

Which statement correctly assigns a library reference to the Excel workbook?
A. libname qtrdata ‘qtr1.xls’;
B. libname ‘qtr1.xls’ sheets=3;
C. libname jan feb mar ‘qtr1.xls’;
D. libname mydata ‘qtr1.xls’ WORK.heets=(jan,feb,mar);

Check Answer
Answer: A

注解:使用Excel SAS/ACCESS LIBNAME Engine读取Excel文件的格式:LIBNAME  libref  ‘文件路径’。

SAS Base (3)

The Excel workbook REGIONS.XLS contains the following four worksheets:
EAST
WEST
NORTH
SOUTH

The following program is submitted:

libname MYXLS ‘regions.xls’;

Which PROC PRINT step correctly displays the NORTH worksheet?
A. proc print data=MYXLS.NORTH;run;
B. proc print data=MYXLS.NORTH$;run;
C. proc print data=MYXLS.’NORTH’e;run;
D. proc print data=MYXLS.’NORTH$’n;run;

Check Answer
Answer: D

注解:使用SAS/ACCESS engine来读取Excel文件,Excel中的每一个worksheet会对应生成2个文件。以NORTH worksheet为例,SAS会生成2个文件:NORTH和NORTH$,worksheet中的数据存储在NORTH$中,但由于“$”并不是合法的data set名字,需要用到n notation。