《SASBase认证考试—70题1120》由会员分享,可在线阅读,更多相关《SASBase认证考试—70题1120(13页珍藏版)》请在金锄头文库上搜索。
1、SAS-Base认证考试70题(11-20) 作者: 日期:SAS Base认证考试70题(11-20)Q 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 ad
2、dedto 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 me
3、ans data=SASHELP.CLASS min max mean maxdec=1;D. output nobs min max mean maxdec=1;答案:C本题知识点:PROC MEANS过程PROC MEANS ;语句;RUN; data=:数据集maxdec=:指定输出结果的小数位数,默认为7位noprint:禁止结果在OTPUT窗口输出alpha:设定可信区间的水平,默认为0.05 MAX、MIN、MEAN、MEDIAN、N、NMISS、RANGE、STDDEV、SUM若不加统计关键词,默认打印的顺序:非缺失值个数(N)、均值(MEAN)、标准差(STDDEV)、最小值(
4、MIN)、最大值(MAX)。 语句若在PROC MEAN过程中没有其他语句,默认输出所有观测值和所有数值变量的统计量。BY:分变量单独分析,数据必须先按变量顺序排序,即PROC SORTCLASS:分变量单独分析,不用排序VAR:指定使用的数值变量Q 12The Excel workbook QTR1.XLS contains the following three worksheets: JAN FEB MARWhich statement correctly assigns a library reference to the Excel workbook?A. libname qtrda
5、ta 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);答案:A本题知识点:LIBNAME语句格式LIBNAME libref SAS-data-library ;Q 13The following SAS program is submitted:data WORK.TEST; set WORK.MEASLES(keep=Janpt Febpt Marpt); array Diff3 Difcoun
6、t1-Difcount3; array Patients3 Janpt Febpt Marpt;run; What new variables are created?A. Difcount1, Difcount2 and Difcount3B. Diff1, Diff2 and Diff3C. Janpt, Febpt, and Marpt D. Patients1, Patients2 and Patients3答案:A本题知识点:数组与其他编程语言的数组相比不同在于,SAS数组的每个元素都对应一个变量名。 数值型数组数组说明中的初始值可省略,默认为缺失值。数组说明中变量可省略,变量名默认
7、为数组名+序号。序号从1开始。ARRAY test(3) Math Chinese English (0,0,0);数组元素的个数由变量个数决定。ARRAY test(*) test3-test8;二维数组,数组元素按行排列。ARRAR x(2,2) x11 x12 x21 x22; 字符型数组字符型数组药指定数组元素的最大长度,其他与数值型数组相同。ARRAY test(2) $ 10 mathor father; 临时数组若SAS数组每个元素不对应变量名,即为临时数组。这与其他编程语言相同。ARRAY test(3) _TEMPORARY_ (0,0,0);临时数组只用于中间计算,不保存入
8、数据集。在数据步中,临时数组在数据步隐含循环中能自动保留上一步得到的值。Q 14Which 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 S
9、tate=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; 答案:C本题知识点:/ debug 语法DEBUG过程的调用方法:在D
10、ATA步后面增加DEBUG选项。Q 15Which 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.答案:D本题知识点:自动变量_ERROR_在PDV过程中,
11、产生很多自动变量,可以在数据步的表达式中使用,在输出数据集中不可见。在PDV过程中,_N_、_ERROR_默认为DROP。在KEEP语句或KEEP=选项中,可以使用除了_N_、_ERROR_之外的变量。Q 16 The following SAS program is submitted:data WORK.DATE_INFO; X=04jul2005d; DayOfMonth=day(x); MonthOfYear=month(x); Year=year(x);run; What types of variables are DayOfMonth, MonthOfYear, and Year
12、?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.答案:B本题知识点:SAS中日期时间及函数起点:1960年1月1日0时0分0秒。若将日期时间标示为数值型常数,需使用相应格式。格式值带单引号,后跟一个D(日期)、T(时间)、DT(日期时间)。日期函数返回值为数值。Q 17Given the following data step: data WORK.GEO; infile datalines; input City $20.; if City=Tulsa then State=OK; Region=Central; if City=Los Angeles