当前位置:首页 > SAS base 考试必备 70真题(附答案)
data WORK.TOTAL;
set WORK.SALARY(keep=Department MonthlyWageRate); by Department;
if First.Department=1 then Payroll=0; Payroll+(MonthlyWageRate*12); if Last.Department=1; run;
Which statement is true?
A. The by statement in the DATA step causes a syntax error.
B. The statement Payroll+(MonthlyWageRate*12); in the data step causes a syntax error.
C. The values of the variable Payroll represent the monthly total for each department in the WORK.SALARY data set.
D. The values of the variable Payroll represent a monthly total for all values of WAGERATE in the WORK.SALARY data set.
Answer: C
-------------------------------------
10.The following SAS program is submitted:
data WORK.RETAIL; Cost='$20,000';
Discount=.10*Cost; run;
What is the result?
A. The value of the variable Discount in the output data set is 2000.No messages are written to the SAS log.
B. The value of the variable Discount in the output data set is 2000.A note that conversion has taken place is written to the SAS log.
C. The value of the variable Discount in the output data set is missing. A note in the SAS log refers to invalid numeric data.
D. The variable Discount in the output data set is set to zero.No messages are written to the SAS log.
Answer: C 因为有一个$符号 -------------------------------------
11.Given the existing SAS program:
proc format;
value agegrp
low-12 ='Pre-Teen' 13-high = 'Teen'; run;
proc means data=SASHELP.CLASS; var Height; class Sex Age; format Age agegrp.; run;
Which statement in the proc means step needs to be modified or added to generate the following results:
Analysis Variable : Height
N
Sex Age Obs Minimum Maximum Mean
------------------------------------------------------------------
F Pre-Teen 3 51.3 59.8 55.8
Teen 6 56.5 66.5 63.0
M Pre-Teen 4 57.3 64.8 59.7
Teen 6 62.5 72.0 66.8 --------------------------------------------------------------------
A. var Height / nobs min max mean maxdec=1; B. proc means data=SASHELP.CLASS maxdec=1 ;
C. proc means data=SASHELP.CLASS min max mean maxdec=1; D. output nobs min max mean maxdec=1;
Answer: C
-------------------------------------
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);
Answer: A
-------------------------------------
13.The following SAS program is submitted:
data WORK.TEST;
set WORK.MEASLES(keep=Janpt Febpt Marpt); array Diff{3} Difcount1-Difcount3; array Patients{3} Janpt Febpt Marpt; run;
What new variables are created?
A. Difcount1, Difcount2 and Difcount3 B. Diff1, Diff2 and Diff3 C. Janpt, Febpt, and Marpt
D. Patients1, Patients2 and Patients3
Answer: A
-------------------------------------
14.Which of the following programs correctly invokes the DATA Step Debugger: A.
data WORK.TEST debug; set WORK.PILOTS;
State=scan(cityState,2,' ');
if State='NE' then description='Central'; run;
B.
data WORK.TEST debugger; set WORK.PILOTS;
State=scan(cityState,2,' ');
if State='NE' then description='Central'; run;
C.
data WORK.TEST / debug; set WORK.PILOTS;
State=scan(cityState,2,' ');
if State='NE' then description='Central';
run;
D.
data WORK.TEST / debugger; set WORK.PILOTS;
State=scan(cityState,2,' ');
if State='NE' then description='Central'; run;
Answer: c
-------------------------------------
15.Which statement is true concerning the SAS automatic variable _ERROR_?
A. It cannot be used in an if/then condition.
B. It cannot be used in an assignment statement.
C. It can be put into a keep statement or keep= option. D. It is automatically dropped.
Answer: D
-------------------------------------
16.The following SAS program is submitted:
data WORK.DATE_INFO; X='04jul2005'd; DayOfMonth=day(x); MonthOfYear=month(x); Year=year(x); run;
What types of variables are DayOfMonth, MonthOfYear, and Year?
A. DayOfMonth, Year, and MonthOfYear are character. B. DayOfMonth, Year, and MonthOfYear are numeric.
C. DayOfMonth and Year are numeric. MonthOfYear is character. D. DayOfMonth, Year, and MonthOfYear are date values.
Answer: B
-------------------------------------
17.Given the following data step:
data WORK.GEO;
共分享92篇相关文档