1、SASbase考试必备70真题 following SAS program is submitted: data ; set ; by Department Gender; if First. then Payroll=0; Payroll+Wagerate; if Last.; run; The SAS data set is currently ordered by Gender within Department.Which inserted code will accumulate subtotals for each Gender within Department? A. Gend
2、er B. Department C. Gender Department D. Department GenderAnswer: A- the following raw data records in : -|-10-|-20-|-30 John,FEB,13,25,14,27,Final John,MAR,26,17,29,11,23,Current Tina,FEB,15,18,12,13,Final Tina,MAR,29,14,19,27,20,Current The following output is desired: Obs Name Month Status Week1
3、Week2 Week3 Week4 Week5 1 John FEB Final $13 $25 $14 $27 . 2 John MAR Current $26 $17 $29 $11 $23 3 Tina FEB Final $15 $18 $12 $13 . 4 Tina MAR Current $29 $14 $19 $27 $20 Which SAS program correctly produces the desired output? A. data ; length Name $ 4 Month $ 3 Status $ 7; infile dsd; input Name
4、$ Month $; if Month=FEB then input Week1 Week2 Week3 Week4 Status $; else if Month=MAR then input Week1 Week2 Week3 Week4 Week5 Status $; format Week1-Week5 dollar6.;run; proc print data=;run; B. data ; length Name $ 4 Month $ 3 Status $ 7; infile dlm=, missover; input Name $ Month $; if Month=FEB t
5、hen input Week1 Week2 Week3 Week4 Status $; else if Month=MAR then input Week1 Week2 Week3 Week4 Week5 Status $; format Week1-Week5 dollar6.;run; proc print data=;run; C. data ; length Name $ 4 Month $ 3 Status $ 7; infile dlm=,; input Name $ Month $ ; if Month=FEB then input Week1 Week2 Week3 Week4
6、 Status $; else if Month=MAR then input Week1 Week2 Week3 Week4 Week5 Status $; format Week1-Week5 dollar6.;run; proc print data=;run; D. data ; length Name $ 4 Month $ 3 Status $ 7; infile dsd ; input Name $ Month $; if Month=FEB then input Week1 Week2 Week3 Week4 Status $; else if Month=MAR then i
7、nput Week1 Week2 Week3 Week4 Week5 Status $; format Week1-Week5 dollar6.;run; proc print data=;run; Answer: C- Excel workbook contains the following four worksheets: EAST WEST NORTH SOUTH The following program is submitted: libname MYXLS ; Which PROC PRINT step correctly displays the NORTH worksheet
8、? A. proc print data=;run; B. proc print data=$;run; C. proc print data=MYXLS.NORTHe;run; D. proc print data=MYXLS.NORTH$n;run; Answer: D- following SAS program is submitted: data ; Day=01 ; Yr=1960 ; X=mdy(Day,01,Yr) ; run; What is the value of the variable X? A. the numeric value 0 B. the characte
9、r value 01011960 C. a missing value due to syntax errors D. the step will not compile because of the character argument in the mdy function. Answer: A- statement specifies that records 1 through 10 are to be read from the raw data file ? A. infile 1-10; B. input stop10; C. infile obs=10; D. input st
10、op=10; Answer: C- a SAS program is submitted, the following is written to the SAS log: 101 data ; 102 set (keep=product month num_Sold Cost); 103 if Month=Jan then output ; 104 Sales=Cost * Num_Sold; 105 keep=Product Sales; - 22 ERROR 22-322: Syntax error, expecting one of the following: !,!, &, *,
11、*, +, -, , =, , =, , =, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL,NOTIN, OR, =, |, |, =. 106 run; What changes should be made to the KEEP statement to correct the errors in the LOG? A. keep=(Product Sales); B. keep Product, Sales; C. keep=Product, Sales; D. keep Product Sales;Answer: D- of t
12、he following choices is an unacceptable ODS destination for producing output that can be viewed in Microsoft Excel? A. MSOFFICE2K B. EXCELXP C. CSVALL D. WINXPAnswer: D- SAS data set named contains 10 observations for each department,and is currently ordered by Department. The following SAS program
13、is submitted: data ; set (keep=Department MonthlyWageRate); by Department; if =1 then Payroll=0; Payroll+(MonthlyWageRate*12); if =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 syn
14、tax error. C. The values of the variable Payroll represent the monthly total for each department in the data set. D. The values of the variable Payroll represent a monthly total for all values of WAGERATE in the data set.Answer: C- following SAS program is submitted: data ; Cost=$20,000; Discount=.1
15、0*Cost; run; What is the result? A. The value of the variable Discount in the output data set is messages are written to the SAS log. B. The value of the variable Discount in the output data set is note that conversion has taken place is written to the SAS log. C. The value of the variable Discount
16、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 messages are written to the SAS log.Answer: C 因为有一个$符号- the existing SAS program: proc format; value agegrp low-12 =Pre-Teen 13-high = Teen; run; proc me
17、ans data=; 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 Teen 6 M Pre-Teen 4 Teen 6 - A. var Height / nobs min ma
18、x mean maxdec=1; B. proc means data= maxdec=1 ; C. proc means data= min max mean maxdec=1; D. output nobs min max mean maxdec=1;Answer: C- Excel workbook contains the following three worksheets: JAN FEB MAR Which statement correctly assigns a library reference to the Excel workbook? A. libname qtrda
19、ta ; B. libname sheets=3; C. libname jan feb mar ; D. libname mydata =(jan,feb,mar);Answer: A- following SAS program is submitted: data ; set (keep=Janpt Febpt Marpt); array Diff3 Difcount1-Difcount3; array Patients3 Janpt Febpt Marpt; run; What new variables are created? A. Difcount1, Difcount2 and
20、 Difcount3 B. Diff1, Diff2 and Diff3 C. Janpt, Febpt, and Marpt D. Patients1, Patients2 and Patients3Answer: A- of the following programs correctly invokes the DATA Step Debugger: A. data debug; set ; State=scan(cityState,2, ); if State=NE then description=Central;run; B. data debugger; set ; State=
21、scan(cityState,2, ); if State=NE then description=Central;run; C. data / debug; set ; State=scan(cityState,2, ); if State=NE then description=Central;run; D. data / debugger; set ; State=scan(cityState,2, ); if State=NE then description=Central;run; Answer: c- statement is true concerning the SAS au
22、tomatic 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- following SAS program is submitted: data ; X=04jul2005d; DayOfMonth=day(x); Month
23、OfYear=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
24、are date values.Answer: B- the following data step: data ; infile datalines; input City $20.; if City=Tulsa then State=OK; Region=Central; if City=Los Angeles then State=CA; Region=Western; datalines; Tulsa Los Angeles Bangor ; run; After data step execution, what will data set contain? A. City Stat
25、e Region- - - Tulsa OK Western Los Angeles CA Western Bangor Western B. City State Region- - - Tulsa OK Western Los Angeles CA Western Bangor C. City State Region- - - Tulsa OK Central Los Angeles CA Western Bangor Western D. City State Region- - - Tulsa OK Central Los CA Western BangorAnswer: A- st
26、atement describes a characteristic of the SAS automatic variable _ERROR_? A. The _ERROR_ variable maintains a count of the number of data errors in a DATA step. B. The _ERROR_ variable is added to the program data vector and becomes part of the data set being created. C. The _ERROR_ variable can be
27、used in expressions in the DATA step. D. The _ERROR_ variable contains the number of the observation that caused the data error.Answer: C- SAS data set contains a numeric variable named Num and a character variable named Char: Num Char - - 1 23 3 23 1 77 The following SAS program is submitted: proc print data
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1