SAS Base认证考试—70题(21-30)
Q 21
Given the SAS data set WORK.PRODUCTS: ProdId Price ProductType Sales Returns ------ ----- ----------- ----- ------- K12S 95.50 OUTDOOR 15 2 B132S 2.99 CLOTHING 300 10 R18KY2 51.99 EQUIPMENT 25 5 3KL8BY 6.39 OUTDOOR 125 15 DY65DW 5.60 OUTDOOR 45 5 DGTY23 34.55 EQUIPMENT 67 2 The following SAS program is submitted:
data WORK.OUTDOOR WORK.CLOTH WORK.EQUIP; set WORK.PRODUCTS; if Sales GT 30;
if ProductType EQ 'OUTDOOR' then output WORK.OUTDOOR; else if ProductType EQ 'CLOTHING' then output WORK.CLOTH; else if ProductType EQ 'EQUIPMENT' then output WORK.EQUIP; run;
How many observations does the WORK.OUTDOOR data set contain? A. 1 B. 2 C. 3 D. 6 答案:B
本题知识点:IF子集、OUPUT语句
子集IF语句对满足条件的观测输出到正在被创建的数据集中。 Q 22
Which step displays a listing of all the data sets in the WORK library? A. proc contents lib=WORK run; B. proc contents lib=WORK.all;run; C. proc contents data=WORK._all_; run; D. proc contents data=WORK _ALL_; run; 答案:C
本题知识点:PROC CONTENTS过程 默认自动打印最近创建的数据集的描述信息 PROC CONTENTS;RUN;
打印当前目录下的全部数据集的描述信息 PROC CONTENTS DATA=_ALL_;RUN; 打印WORK临时逻辑库下数据集的描述信息 PROC CONTENTS DATA=WORK._ALL_;RUN; Q 23
Which is a valid LIBNAME statement? A. libname \ B. sasdata libname \ C. libname sasdata \ D. libname sasdata sas \ 答案:C
本题知识点:LIBNAME定义逻辑库 参考第12题。 Q 24
Given the following raw data records: ----|----10---|----20---|----30 Susan*12/29/1970*10 Michael**6
The following output is desired: Obs employee bdate years 1 Susan 4015 10 2 Michael . 6
Which SAS program correctly reads in the raw data? A. data employees;
infile 'file specification' dlm='*';
input employee $ bdate : mmddyy10. years; run;
B. data employees;
infile 'file specification' dsd='*';
input employee $ bdate mmddyy10. years; run;
C. data employees;
infile 'file specification' dlm dsd;
input employee $ bdate mmddyy10. years; run;
D. data employees;
infile 'file specification' dlm='*' dsd; input employee $ bdate : mmddyy10. years; run; 答案:D
本题知识点:INFILE语句 参考第2题。 Q 25
Given the following code:
proc print data=SASHELP.CLASS(firstobs=5 obs=15); where Sex='M'; run;
How many observations will be displayed? A. 11 B. 15
C. 10 or fewer D. 11 or fewer 答案:D
本题知识点:WHERE子集 计算15-5+1=11个。
WHERE子集的观测最多为11个。 Q 26
Which step sorts the observations of a permanent SAS data set by two variables and stores the sorted observations in a temporary SAS data set? A. proc sort out=EMPLOYEES data=EMPSORT; by Lname and Fname; run;
B. proc sort data=SASUSER.EMPLOYEES out=EMPSORT; by Lname Fname; run;
C. proc sort out=SASUSER.EMPLOYEES data=WORK.EMPSORT; by Lname Fname; run;
D. proc sort data=SASUSER.EMPLOYEES out=SASUSER.EMPSORT; by Lname and Fname; run; 答案:B
本题知识点:永久数据集、临时数据集 逻辑库.成员 逻辑库 数据集
DATA weight; work(默认) 临时的 DATA work.weight; work 临时的 DATA bikes.weight; Bikes 永久的 Q 27
Given the SAS data set WORK.TEMPS: Day Month Temp --- ----- ----