SASBase认证考试70题1120.docx
- 文档编号:6102847
- 上传时间:2023-01-03
- 格式:DOCX
- 页数:10
- 大小:17.82KB
SASBase认证考试70题1120.docx
《SASBase认证考试70题1120.docx》由会员分享,可在线阅读,更多相关《SASBase认证考试70题1120.docx(10页珍藏版)》请在冰豆网上搜索。
SASBase认证考试70题1120
SAS-Base认证考试—70题(11-20)
SASBase认证考试—70题(11-20)
Q11
GiventheexistingSASprogram:
procformat;
valueagegrp
low-12='Pre-Teen'
13-high='Teen';
run;
procmeansdata=SASHELP.CLASS;
varHeight;
classSexAge;
formatAgeagegrp.;
run;
Whichstatementintheprocmeansstepneedstobemodifiedoradded
togeneratethefollowingresults:
AnalysisVariable:
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.varHeight/nobsminmaxmeanmaxdec=1;
B.procmeansdata=SASHELP.CLASSmaxdec=1;
C.procmeansdata=SASHELP.CLASSminmaxmeanmaxdec=1;
D.outputnobsminmaxmeanmaxdec=1;
答案:
C
本题知识点:
PROCMEANS过程
PROCMEANS
语句;
RUN;
∙
data=:
数据集
maxdec=:
指定输出结果的小数位数,默认为7位
noprint:
禁止结果在OTPUT窗口输出
alpha:
设定可信区间的α水平,默认为0.05
∙
MAX、MIN、MEAN、MEDIAN、N、NMISS、RANGE、STDDEV、SUM
若不加统计关键词,默认打印的顺序:
非缺失值个数(N)、均值(MEAN)、标准差(STDDEV)、最小值(MIN)、最大值(MAX)。
∙ 语句
若在PROCMEAN过程中没有其他语句,默认输出所有观测值和所有数值变量的统计量。
BY:
分变量单独分析,数据必须先按变量顺序排序,即PROCSORT
CLASS:
分变量单独分析,不用排序
VAR:
指定使用的数值变量
Q12
TheExcelworkbookQTR1.XLScontainsthe
followingthreeworksheets:
JAN
FEB
MAR
WhichstatementcorrectlyassignsalibraryreferencetotheExcelworkbook?
A.libnameqtrdata'qtr1.xls';
B.libname'qtr1.xls'sheets=3;
C.libnamejanfebmar'qtr1.xls';
D.libnamemydata'qtr1.xls'WORK.heets=(jan,feb,mar);
答案:
A
本题知识点:
LIBNAME语句格式
LIBNAMElibref
Q13
ThefollowingSASprogramissubmitted:
dataWORK.TEST;
setWORK.MEASLES(keep=JanptFebptMarpt);
arrayDiff{3} Difcount1-Difcount3;
arrayPatients{3}JanptFebptMarpt;
run;
Whatnewvariablesarecreated?
A.Difcount1,Difcount2andDifcount3
B.Diff1,Diff2andDiff3
C.Janpt,Febpt,andMarpt
D.Patients1,Patients2andPatients3
答案:
A
本题知识点:
数组
与其他编程语言的数组相比不同在于,SAS数组的每个元素都对应一个变量名。
∙数值型数组
数组说明中的初始值可省略,默认为缺失值。
数组说明中变量可省略,变量名默认为数组名+序号。
序号从1开始。
ARRAYtest(3)MathChineseEnglish(0,0,0);
数组元素的个数由变量个数决定。
ARRAYtest(*)test3-test8;
二维数组,数组元素按行排列。
ARRARx(2,2)x11x12x21x22;
∙字符型数组
字符型数组药指定数组元素的最大长度,其他与数值型数组相同。
ARRAYtest
(2)$10mathorfather;
∙临时数组
若SAS数组每个元素不对应变量名,即为临时数组。
这与其他编程语言相同。
ARRAYtest(3)_TEMPORARY_(0,0,0);
临时数组只用于中间计算,不保存入数据集。
在数据步中,临时数组在数据步隐含循环中能自动保留上一步得到的值。
Q14
WhichofthefollowingprogramscorrectlyinvokestheDATAStepDebugger:
A.dataWORK.TESTdebug;
setWORK.PILOTS;
State=scan(cityState,2,'');
ifState='NE'thendescription='Central';
run;
B.data WORK.TESTdebugger;
setWORK.PILOTS;
State=scan(cityState,2,'');
ifState='NE'thendescription='Central';
run;
C.dataWORK.TEST/debug;
setWORK.PILOTS;
State=scan(cityState,2,'');
ifState='NE'thendescription='Central';
run;
D.data WORK.TEST/debugger;
setWORK.PILOTS;
State=scan(cityState,2,'');
ifState='NE'thendescription='Central';
run;
答案:
C
本题知识点:
/debug语法
DEBUG过程的调用方法:
在DATA步后面增加DEBUG选项。
Q15
WhichstatementistrueconcerningtheSASautomaticvariable_ERROR_?
A.Itcannotbeusedinanif/thencondition.
B.Itcannotbeusedinanassignmentstatement.
C.Itcanbeputintoakeepstatementorkeep=option.
D.Itisautomaticallydropped.
答案:
D
本题知识点:
自动变量_ERROR_
在PDV过程中,产生很多自动变量,可以在数据步的表达式中使用,在输出数据集中不可见。
在PDV过程中,_N_、_ERROR_默认为DROP。
在KEEP语句或KEEP=选项中,可以使用除了_N_、_ERROR_之外的变量。
Q16
ThefollowingSASprogramissubmitted:
dataWORK.DATE_INFO;
X='04jul2005'd;
DayOfMonth=day(x);
MonthOfYear=month(x);
Year=year(x);
run;
WhattypesofvariablesareDayOfMonth,MonthOfYear,andYear?
A.DayOfMonth,Year,andMonthOfYeararecharacter.
B.DayOfMonth,Year,andMonthOfYeararenumeric.
C.DayOfMonthandYeararenumeric.MonthOfYearischaracter.
D.DayOfMonth,Year,andMonthOfYeararedatevalues.
答案:
B
本题知识点:
SAS中日期时间及函数
起点:
1960年1月1日0时0分0秒。
若将日期时间标示为数值型常数,需使用相应格式。
格式值带单引号,后跟一个D(日期)、T(时间)、DT(日期时间)。
日期函数返回值为数值。
Q17
Giventhefollowingdatastep:
dataWORK.GEO;
infiledatalines;
inputCity$20.;
ifCity='Tulsa'then
State='OK';
Region='Central';
ifCity='LosAngeles'then
State='CA';
Region='Western';
datalines;
Tulsa
LosAngeles
Bangor
;
run;
Afterdatastepexecution,whatwilldatasetWORK.GEOcontain?
A.City State Region
----------- ----- -------
Tulsa OK Western
LosAngeles CA Western
Bangor Western
B.City State Region
----------- ----- -------
Tulsa OK Western
LosAngeles CA Western
Bangor
C.City State Region
----------- ----- -------
Tulsa OK Central
LosAngeles CA Western
Bangor Western
D.City State Region
----------- ----- -------
Tulsa OK Central
Los CA Western
Bangor
答案:
A
本题知识点:
IF语句
若执行语句不能在一个语句完成,则使用复合语句DO和END
IF条件THEN语句;
没有ENDIF,没有IF-ELSEIF-ELSE多分支结构,语句1只能是一个语句。
IF条件THEN语句1;
Q18
WhichstatementdescribesacharacteristicoftheSASautomaticvariable_ERROR_?
A.The_ERROR_variablemaintainsacountofthenumberofdataerrorsinaDATAstep.
B.The_ERROR_variableisaddedtotheprogramdatavectorandbecomespartofthedatasetbeingcreated.
C.The_ERROR_variablecanbeusedinexpressionsintheDATAstep.
D.The_ERROR_variablecontainsthenumberoftheobservationthatcausedthedataerror.
答案:
C
本题知识点:
WHERE语句
类似第15题。
Q19
TheSASdatasetWORK.ONEcontainsanumericvariablenamedNumandacharactervariablenamedChar:
WORK.ONE
Num Char
--- ----
1 23
3 23
1 77
ThefollowingSASprogramissubmitted:
procprintdata=WORK.ONE;
whereNum='1';
run;
Whatisoutput?
A.Num Char
--- ----
1 23
B.Num Char
--- ----
1 23
1 77
C.Num Char
--- ----
1 23
3 23
1 77
D.Nooutputisgenerated.
答案:
D
本题知识点:
WHERE语句
WHERE语句无法找到满足条件的观测。
Q20
ThedatasetWORK.REALESTATEhasthevariableLocalFeewithaformatof9.andavariableCountryFeewithaformatof7.;
ThefollowingSASprogramissubmitted:
dataWORK.FEE_STRUCTURE;
formatLocalFeeCountryFeepercent7.2;
setWORK.REALESTAT;
LocalFee=LocalFee/100;
CountryFee=CountryFee/100;
run;
WhataretheformatsofthevariablesLOCALFEEandCOUNTRYFEEintheoutputdataset?
A.LocalFeehasformatof9.andCountryFeehasaformatof7.
B.LocalFeehasformatof9.andCountryFeehasaformatofpercent7.2
C.BothLocalFeeandCountryFeehaveaformatofpercent7.2
D.Thedatastepfailsexecution;thereisnoformatforLocalFee.
答案:
C
本题知识点:
FORMAT语句
FORMAT语句为非执行语句。
FORMAT语句在SET语句前后均无差别。
FORMAT可以使用在数据步和过程步中,前者把格式永久存储,后者只是临时存储(当前过程中有作用)。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SASBase 认证 考试 70 1120
![提示](https://static.bdocx.com/images/bang_tan.gif)