SAS-Base认证考试—70题(11-20)_第1页
SAS-Base认证考试—70题(11-20)_第2页
SAS-Base认证考试—70题(11-20)_第3页
SAS-Base认证考试—70题(11-20)_第4页
SAS-Base认证考试—70题(11-20)_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

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

文档简介

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 addedto 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;答案: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)、最小值(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 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);答案: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 Difcount1-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数组的每个元素都对应一个变量名。 数值型数组数组说明中的初始值可省略,默认为缺失值。数组说明中变量可省略,变量名默认为数组名+序号。序号从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);临时数组只用于中间计算,不保存入数据集。在数据步中,临时数组在数据步隐含循环中能自动保留上一步得到的值。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 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; 答案:C本题知识点:/ debug 语法DEBUG过程的调用方法:在DATA步后面增加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过程中,产生很多自动变量,可以在数据步的表达式中使用,在输出数据集中不可见。在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?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 then State=CA; Region=Western; datalines; TulsaLos AngelesBangor;run; After data step execution, what will data set WORK.GEO contain? A. City State Region - - - Tulsa OK Western Los Angeles CA Western Bangor Western B. City State Region - - - Tulsa OK Western Los Angeles CA Western BangorC. City State Region - - - Tulsa OK Central Los Angeles CA Western Bangor Western D. City State Region - - - Tulsa OK Central Los CA Western Bangor答案:A本题知识点:IF语句若执行语句不能在一个语句完成,则使用复合语句DO和ENDIF 条件 THEN 语句;没有ENDIF,没有IF-ELSEIF-ELSE多分支结构,语句1只能是一个语句。IF 条件 THEN 语句1;;Q 18Which statement 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 used in expressions in the DATA step.D. The _ERROR_ variable contains the number of the observation that caused the data error.答案:C本题知识点:WHERE语句类似第15题。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 77 The following SAS program is submitted:proc print data=WORK.ONE; where Num=1;run;What is output?A. Num Char - - 1 23B. Num Char - - 1 23 1 77C. Num Char - - 1 23 3 23 1 77D. No output is generated.答案:D本题知识点:WHERE语句WHERE语句无法找到满足条件的观测。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; format 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. Lo

温馨提示

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

评论

0/150

提交评论