SAS-base-70题(无答案版-适合练习)_第1页
SAS-base-70题(无答案版-适合练习)_第2页
SAS-base-70题(无答案版-适合练习)_第3页
SAS-base-70题(无答案版-适合练习)_第4页
SAS-base-70题(无答案版-适合练习)_第5页
已阅读5页,还剩26页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、SAS Basel证考试一70题Q 11. The following SAS program is submitted:data WORK.TOTAL;set WORK.SALARY;by Department Gender;if First.<_insert_code_> then Payroll=0;Payroll+Wagerate;if Last.<_insert_code_>run;The SAS data set WORK.SALARY is currently ordered by Gender within Department.Which insert

2、ed code will accumulate subtotals for each Gender within Department?A. GenderB. DepartmentC. Gender DepartmentD. Department GenderQ 2Given the following raw data records in TEXT:| 10-| 20-| 30John,FEB,13,25,14,27,FinalJohn,MAR,26,17,29,11,23,CurrentTina,FEB,15,18,12,13,FinalTina,MAR,29,14,19,27,20,C

3、urrentThe following output is desired:Obs Name Month Status Week1 Week2 Week3 Week4 Week51 John FEB Final$13$25$14$272JohnMARCurrent$26$17$29$11$233TinaFEBFinal$15$18$12$13.4TinaMARCurrent$29$14$19$27$20Which SAS program correctly produces the desired output?A. data WORK.NUMBERS;length Name $ 4 Mont

4、h $ 3 Status $ 7;infile 'TEXT' dsd;input Name $ 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=WORK.NUMBERS;run;B. data WORK.NUMBERS;lengt

5、h Name $ 4 Month $ 3 Status $ 7;infile 'TEXT' dlm=',' missover;input Name $ 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=WORK.NU

6、MBERS;run;C. data WORK.NUMBERS;length Name $ 4 Month $ 3 Status $ 7;infile 'TEXT' dlm=','input Name $ 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.;

7、run;proc print data=WORK.NUMBERS;run;D. data WORK.NUMBERS;length Name $ 4 Month $ 3 Status $ 7;infile 'TEXT' dsd ;input Name $ 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

8、-Week5 dollar6.;run;proc print data=WORK.NUMBERS;run;The following SAS program is submitted: data WORK.DATE_INFO;Day="01" ;Yr=1960 ;X=mdy(Day,01,Yr) ;run;What is the value of the variable X?A. the numeric value 0B. the character value "01011960"C. a missing value due to syntax er

9、rorsD. the step will not compile because of the character argument in the mdy function.Q 4The Excel workbook REGIONS.XLS contains the following four worksheets:EASTWESTNORTHSOUTHThe following program is submitted:libname MYXLS 'regions.xls'Which PROC PRINT step correctly displays the NORTH w

10、orksheet?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;Q 5Which statement specifies that records 1 through 10 are to be read from the raw dataA. infile 'customer.txt' 1-10;B.

11、 input 'customer.txt' stop10;C. infile 'customer.txt' obs=10;D. input 'customer.txt' stop=10;Q 6After a SAS program is submitted, the following is written to the SAS log:101 data WORK.JANUARY;102 set WORK.ALLYEAR(keep=product month num_Sold Cost);103if Month='Jan' the

12、n output WORK.JANUARY;104Sales=Cost * Num_Sold;105 keep=Product Sales;22ERROR 22-322: Syntax error, expecting one of the following: !,!, &, *, *, +, -, <=, <>, =, >, >=,AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL,NOTIN, OR, A二, |, |, 二.106 run;What changes should be made to

13、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;Q 7Which of the following choices is an unacceptable ODSdestination for producing output that can be viewed in Microsoft Excel?A. MSOFFICE2KB. EXCELXPC. CSV

14、ALLD. WINXPQ 8The SAS data set named WORK.SALARY contains 10 observations for each department, and is currently ordered by Department.The following SAS program is submitted:data WORK.TOTAL;set WORK.SALARY(keep=Department MonthlyWageRate);by Department;if First.Department=1 then Payroll=0;Payroll+(Mo

15、nthlyWageRate*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

16、 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.Q 9data course;input exam;datalines;50.1run;proc format;value score 1 -50 =' Fail '51 -100 ='Pass';run;proc report data =course nowd;column

17、 exam;define exam / display format=score.; run;What is the value for exam?A. FailB. PassC. 50.1D. No outputQ 10The 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.

18、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.

19、D. The variable Discount in the output data set is set to zero. No messages are written to the SAS log.Q 11Given 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;Whi

20、ch statement in the proc means step needs to be modified or added to generate the following results:Analysis Variable : HeightNSex AgeObsMinimumMaximumMeanF Pre-Teen 3Teen6M Pre-Teen 4Teen651.359.855.856.566.563.057.364.859.762.572.066.8A. var Height / nobs min max mean maxdec=1;B. proc means data=S

21、ASHELP.CLASS maxdec=1 ;C. proc means data=SASHELP.CLASS min max mean maxdec=1;D. output nobs min max mean maxdec=1;Q 12The Excel workbook QTR1.XLS contains thefollowing three worksheets:JANFEBMARWhich statement correctly assigns a library reference to the Excel workbook?A. libname qtrdata 'qtr1.

22、xls'B. libname 'qtr1.xls' sheets=3;C. libname jan feb mar 'qtr1.xls'D. libname mydata 'qtr1.xls' WORK.heets=(jan,feb,mar);Q 13The following SAS program is submitted:data WORK.TEST;set WORK.MEASLES(keep=Janpt Febpt Marpt);array Diff3 Difcount1-Difcount3;array Patients3 Jan

23、pt Febpt Marpt;run;What new variables are created?A. Difcount1, Difcount2 and Difcount3B. Diff1, Diff2 and Diff3C. Janpt, Febpt, and MarptD. Patients1, Patients2 and Patients3Q 14Which of the following programs correctly invokes the DATA Step Debugger:A. data WORK.TEST debug;set WORK.PILOTS;State=sc

24、an(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,''

25、);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;Q 15Which statement is true concerning the SAS automatic variable _ERROR_?A. It cannot be used in

26、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.Q 16The following SAS program is submitted:data WORK.DATE_INFO;X='04jul2005'd;DayOfMonth=day(x);MonthOfYear=month(x);Year=year(x);run;Wha

27、t 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.Q 17Given the following dat

28、a step:data WORK.GEO;in;input City $20.;if City='Tulsa' thenState='OK'Region='Central'if City='Los Angeles' thenState='CA'Region='Western'datalines;TulsaLos AngelesBangor ;run;After data step execution, what will data set WORK.GEO contain?A. City State

29、 RegionTulsa OK WesternLos Angeles CA WesternBangorWesternB. City State RegionTulsa OK Western Los Angeles CA Western BangorC. CityState Region TulsaOK CentralLos Angeles CA Western BangorWesternD. City State RegionTulsaOKCentralLosCAWesternBangorQ 18Which statement describes a characteristic of the

30、 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 used in expressions in the DATA step.D. The

31、_ERROR_ variable contains the number of the observation that caused the data error.Q 19The SAS data set WORK.ONE contains a numeric variable named Num and a character variable named Char:WORK.ONE Num Char 1 23 3 23 1 77The following SAS program is submitted: proc print data=WORK.ONE; where Num='

32、1' run; What is output? A. Num Char 123B. Num Char 123177C. Num Char 123323177D. No output is generated.Q 20The data set WORK.REALESTATE has the variable LocalFee with a format of 9. and a variable CountryFee with a format of 7.;The following SAS program is submitted: data WORK.FEE_STRUCTURE;for

33、mat LocalFee CountryFee percent7.2; set WORK.REALESTAT;LocalFee=LocalFee/100;CountryFee=CountryFee/100; run;What are the formats of the variables LOCALFEE and COUNTRYFEE in the output dataset?A. LocalFee has format of 9. and CountryFee has a format of 7.B. LocalFee has format of 9. and CountryFee ha

34、s a format of percent7.2C. Both LocalFee and CountryFee have a format of percent7.2D. The data step fails execution; there is no format for LocalFee.Q 21Given the SAS data set WORK.PRODUCTS:ProdIdPriceProductTypeSalesReturns-K12S95.50OUTDOOR152B132S2.99CLOTHING30010R18KY251.99EQUIPMENT2553KL8BY6.39O

35、UTDOOR12515DY65DW5.60OUTDOOR455DGTY2334.55EQUIPMENT672The 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

36、ProductType EQ 'EQUIPMENT' then output WORK.EQUIP; run;How many observations does the WORK.OUTDOOR data set contain?A. 1B. 2C. 3D. 6Q 22Which 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

37、=WORK._all_; run;D. proc contents data=WORK _ALL_; run;Q 23Which 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_l

38、ibrary_location_"Q 24Given the following raw data records:10-+20-+30Susan*12/29/1970*10Michael*6The following output is desired:Obs employee bdate years1 Susan 4015 102 Michael .6Which SAS program correctly reads in the raw data?A. data employees;infile '' dlm='*'input employee

39、$ bdate : mmddyy10. years; run;B. data employees;infile '' dsd='*'input employee $ bdate mmddyy10. years;run;C. data employees;infile '' dlm dsd;input employee $ bdate mmddyy10. years;run;D. data employees;infile '' dlm='*' dsd;input employee $ bdate : mmddyy1

40、0. years; run;Q 25Given the following code:proc print data=SASHELP.CLASS(firstobs=5 obs=15); where Sex='M'run;How many observations will be displayed?A. 11B. 15C. 10 or fewerD. 11 or fewerQ 26Which step sorts the observations of a permanent SAS data set by two variables and stores the sorted

41、 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;

42、 by Lname and Fname;run;Q 27Given the SAS data set WORK.TEMPS:Day Month Temp 1 May 7515 May 7015 June 803 June 762 July 8514 July 89The following program is submitted:proc sort data=WORK.TEMPS;by descending Month Day;run;proc print data=WORK.TEMPS;run;Which output is correct?A.Obs Day Month Temp12Ju

43、ly85214July8933June76415June805 1May756 15May7B.Obs Day Month Temp11May7522July8533June76414July89515May70615June80C.Obs Day Month Temp11 May 75215May7033June76415June8052July85614July89D.Obs Day Month Temp115May7021May75315June8043June76514July8962July85Q 28Given the SAS data set WORK.P2000:Locatio

44、nPop2000Alaska626931Delaware783595Vermont608826Wyoming493782and the SAS data set WORK.P2008:State Pop2008Alaska 686293Delaware 873092Wyoming 532668The following output is desired:Obs StatePop2000 Pop2008 Difference1 Alaska626931686293593622 Delaware 783595873092894973 Wyoming 49378253266838886Which

45、SAS program correctly combines the data?A. data compare;merge WORK.P2000(in=_a Location=State)WORK.P2008(in=_b);by State;if _a and _b;Difference=Pop2008-Pop2000;run;B. data compare;merge WORK.P2000(rename=(Location=State) WORK.P2008;by State;if _a and _b;Difference=Pop2008-Pop2000;run;C. data compar

46、e;merge WORK.P2000(in=_a rename=(Location=State)WORK.P2008(in=_b);by State;if _a and _b;Dference=Pop2008-Pop2000;run;D. data compare;merge WORK.P2000(in=_a) (rename=(Location=State)WORK.P2008(in=_b);by State;if _a and _b;Difference=Pop2008-Pop2000;run;Q 29The following SAS program is sumbitted:data

47、WORK.INFO;infile 'DATA'input 1 Company $20. 25 State $2. ;if State=' ' then input 30 Year;else input 30 City Year;input NumEmployees;run;How many raw data records are read during each iteration of the DATA step?A. 1B. 2C. 3D. 4Q 30You're attempting to read a raw data you see the

48、following messages displayed in the SAS Log: NOTE: Invalid data for Salary in line 4 15-23.RULE:+1+2+3+4+5-4120104 F 46#3011MAY1954 33Employee_Id=120104 employee_gender=F Salary=. birth_date=-2061 _ERROR_=1 _N_=4NOTE: 20 records were read from the infile 'c:employees.dat'.The minimum record

49、length was 33.The maximum record length was 33.NOTE: The data set WORK.EMPLOYEES has 20 observations and 4 variables.What does it mean?A. A compiler error, triggered by an invalid character for the variable Salary.B. An execution error, triggered by an invalid character for the variable Salary.C. Th

50、e 1st of potentially many errors, this one occurring on the 4th observation.D. An error on the INPUT statement specification for reading the variable Salary.Q 31Given the following raw data records in DATA:10-+20-+-30Kim,Basketball,Golf,TennisBill,FootballTracy,Soccer,TrackThe following program is s

51、ubmitted:data WORK.SPORTS_INFO;length Fname Sport1-Sport3 $ 10;infile 'DATA' dlm=','input Fname $ Sport1 $ Sport2 $ Sport3 $;run;proc print data=WORK.SPORTS_INFO;run;Which output is correct based on the submitted program?A.Obs 1 23 B.Obs 12 3C.Obs 12 D.Obs 12Fname Sport1 Kim Basketba

52、ll Bill Football Tracy SoccerSport2 Sport3Golf TennisTrackFname Sport1Sport2 Sport3Kim Basketball Golf Tennis Bill Football Football Football Tracy Soccer Track TrackFname Sport1Sport2 Sport3Kim Basketball Golf Tennis Bill Football Tracy SoccerFname Sport1 Sport2 Sport3 Kim Basketball Golf Tennis Bi

53、ll FootballQ 32Consider the following data step:data WORK.NEW;set WORK.OLD;Count+1;run;The variable Count is created using a sum statement. Which statement regarding this variable is true?A. It is assigned a value 0 when the data step begins execution.B. It is assigned a value of missing when the da

54、ta step begins execution.C. It is assigned a value 0 at compile time.D. It is assigned a value of missing at compile time.Q 33The following SAS program is submitted:data WORK.TEST;set WORK.PILOTS;if Jobcode='Pilot2' then Description='Senior Pilot'else Description='Unknown'run

55、;The value for the variable Jobcode is: PILOT2.What is the value of the variable Description?A. PILOT2B. UnknownC. Senior PilotD. ' ' (missing character value)Q 34A user-defined format has been created using the FORMAT procedure. How is it stored?A. in a SAS catalogB. in a memory resident lo

56、okup tableC. in a SAS dataset in the WORK libraryD. in a SAS dataset in a permanent SAS data libraryQ 35Given the SAS data set SASDATA.TWO:X Y-5 23 15 6The following SAS program is submitted: dataSASUSER.ONESASUSER.TWOOTHER;set SASDATA.TWO;if X eq 5 then output SASUSER.ONE;if Y lt 5 then output SASUSER.TWO;output;run;What is the result?A. data set SASUSER.ONE has 5 observationsdata set SASUSER.TWO has 5 observationsdata set WORK.OTHER has 3 observationsB. data set SASUSER.ONE has 2 observationsdata set SASUSER.TWO has 2 observationsdata set WORK.OTHER has 1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论