SASBase认证考试70题5160.docx
- 文档编号:3483788
- 上传时间:2022-11-23
- 格式:DOCX
- 页数:10
- 大小:52.37KB
SASBase认证考试70题5160.docx
《SASBase认证考试70题5160.docx》由会员分享,可在线阅读,更多相关《SASBase认证考试70题5160.docx(10页珍藏版)》请在冰豆网上搜索。
SASBase认证考试70题5160
SAS-Base认证考试—70题(51-60)
5463 Accounting
Thefollowingprogramissubmitted:
dataWORK.ALL;
mergeWORK.EMP_NAME(in=Emp_N)
WORK.EMP_DEPT(in=Emp_D);
byEmpid;
if(Emp_NandnotEmp_D)or(Emp_DandnotEmp_N);
run;
HowmanyobservationsareindatasetWORK.ALLaftersubmittingtheprogram?
A.1
B.2
C.3
D.5
答案:
B
本题知识点:
MERGE合并数据集、IF子集
找出两个数据集中不重合的观测个数。
Q53
ThefollowingSASprogramissubmitted:
dataWORK.TOTAL_SALARY;
retainTotal;
setWORK.SALARY;
byDepartment;
ifFirst.Department
thenTotal=0;
Total=sum(Total,Wagerate);
ifLast.Total;
run;
WhatistheinitialvalueofthevariableTotal?
A.0
B.Missing
C.ThevalueofthefirstobservationsWagerate
D.Cannotbedeterminedfromtheinformationgiven
答案:
B
本题知识点:
RETAIN语句
retain语句是非执行语句。
retain;/*针对所有变量*/
retainxy;
retainx1-x5;
retainx1-x510ab‘abc’;
retainx1-x5
(1);/*x1=1,其余为缺失值*/
retainx1-x4(1234);
retainx1-x4(1:
4);
arrayarr
(2)xy;retainarr;
Q54
Considerthefollowingdatastep:
dataWORK.TEST;
setSASHELP.CLASS(obs=5);
retainCity'BeverlyHills';
State='California';
run;
ThecomputedvariablesCityandStatehavetheirvaluesassignedusingtwodifferentmethods,aRETAINstatementandanAssignmentstatement.Whichstatementregardingthisprogramistrue?
A.TheRETAINstatementisfine,butthevalueofCitywillbetruncatedto8bytesastheLENGTHstatementhasbeenomitted.
B.BoththeRETAINandassignmentstatementarebeingusedtoinitializenewvariablesandareequallyefficient.Methodusedisamatterofprogrammerpreference.
C.Theassignmentstatementisfine,butthevalueofCitywillbetruncatedto8bytesastheLENGTHstatementhasbeenomitted.
D.City'svaluewillbeassignedonetime,State'svalue5times.
答案:
D
本题知识点:
RETAIN语句
一般,SAS每读一遍DATA步的所有语句,PDV清空所有所有变量值,并设置为缺失值。
再执行INPUT语句或赋值语句,再次对变量赋值。
如果在DATA步中使用RETAIN语句,不会清空RETAIN对应的变量,保留到该变量下次再次被执行。
Q55
ThefollowingSASprogramissubmitted:
dataWORK.DATE_INFO;
X="01Jan1960"D;
run;
VariableXcontainswhatvalue?
A.thenumericvalue0
B.thecharactervalue"01Jan1960"
C.thedatevalue01011960
D.thecodecontainsasyntaxerroranddoesnotexecute.
答案:
D
本题知识点:
日期时间的表示格式
起点:
1960年1月1日0时0分0秒。
若将日期时间标示为数值型常数,需使用相应格式。
格式值带单引号,后紧跟跟一个D(日期)、T(时间)、DT(日期时间)。
在表示为数值常数时,不支持MMDDYYw.格式,支持datew.格式。
本题,答案C,是因为X="01Jan1960"D;中D之前有个空格。
若改为X="01Jan1960"D;,答案就是A。
若改为X="01011960"D;,答案就是D。
Q56
ThefollowingoutputiscreatedbytheFREQUENCYprocedure:
TheFREQProcedure
Tableofregionbyproduct
region product
Frequency|
Percent |
RowPct |
ColPct |corn |cotton |oranges| Total
---------+--------+--------+--------+
EAST | 2| 1| 1| 4
| 22.22| 11.11| 11.11| 44.44
| 50.00| 25.00| 25.00|
| 50.00| 33.33| 50.00|
---------+--------+--------+--------+
SOUTH | 2| 2| 1| 5
| 22.22| 22.22| 11.11| 55.56
| 40.00| 40.00| 20.00|
| 50.00| 66.67| 50.00|
---------+--------+--------+--------+
Total 4 3 2 9
44.44 33.33 22.22 100.00
WhichTABLESstatementwasusedtocompletedthefollowingprogramthatproducedtheoutput?
procfreqdata=sales;
<_insert_code_>
run;
A.tablesregionproduct;
B.tablesregion,product
C.tablesregion/product;
D.tablesregion*product;
答案:
D
本题知识点:
PROCFREQ过程
参考第47题。
Q57
GiventheSASdatasetWORK.ONE:
N BeginDate
- ---------
1 09JAN2010
2 12JAN2010
ThefollowingSASprogramissubmitted:
dataWORK.TWO;
setWORK.ONE;
Day=<_insert_code_>;
formatBeginDatedate9.;
run;
ThedatasetWORK.TWOiscreated,whereDaywouldbe1forSunday,2forMonday,3forTuesday,...:
WORK.TWO
N BeginDate Day
- --------- ---
1 09JAN2010 1
2 12JAN2010 4
WhichexpressionsuccessfullycompletedtheprogramandcreatesthevariableDay?
A.day(BeginDate)
B.weekday(BeginDate)
C.dayofweek(BeginDate)
D.getday(BeginDate,today())
答案:
B
本题知识点:
日期时间函数
WEEKDAY(date)返回SAS日期值为一周的第几天
Q58
Thefollowingprogramissubmitted:
procformat;
valuesalfmt.
0-<50000 ='Lessthan50K'
50000-high='50KorGreater';
optionsfmterrnodatepageno=1;
title'EmployeeReport';
procprintdata=work.employeesnoobs;
varfullnamesalaryhiredate;
format
salarysalfmt.
hiredatedate9.;
label
fullname='NameofEmployee'
salary='AnnualSalary'
hiredate='DateofHire';
run;
Whydoestheprogramfail?
A.ThePAGENOoptionisinvalidintheOPTIONSstatement.
B.TheRUNstatementismissingaftertheFORMATprocedure.
C.TheformatnamecontainsaperiodintheVALUEstatement.
D.TheLABELoptionismissingfromthePROCPRINTstatement.
答案:
C
本题知识点:
FORMAT语句、PROCFORMAT过程
参考第9题。
Q59
GiventhecontentsoftherawdatafileTYPECOLOR.DAT:
----+----10---+----20---+----30
daisyyellow
ThefollowingSASprogramissubmitted:
dataFLOWERS;
infile'TYPECOLOR.DAT'truncover;
length
Type$5
Color$11;
input
Type$
Color$;
run;
WhatarethevaluesofthevariablesTypeandColor?
A.Type=daisy,Color=yellow
B.Type=daisy,Color=w
C.Type=daisy,Color=daisyyellow
D.Type=daisy,Color=
答案:
D
本题知识点:
INFILE语句
参考第5题。
Q60
GiventheSASdatasetWORK.PRODUCTS:
ProdId Price ProductType Sales Returns
------ ----- ----------- ----- -------
K12S 95.50 OUTDOOR 15 2
B132S 2.99 CLOTHING 300 10
R18KY2 51.99 EQUIPMENT 25 5
3KL8BY 6.39 OUTDOOR 125 15
DY65DW 5.60 OUTDOOR 45 5
DGTY23 34.55 EQUIPMENT 67 2
ThefollowingSASprogramissubmitted:
dataWORK.REVENUE(drop=SalesReturnsPrice);
setWORK.PRODUCTS(keep=ProdIdPriceSalesReturns);
Revenue=Price*(Sales-Returns);
run;
HowmanyvariablesdoestheWORK.REVENUEdatasetcontain?
A.2
B.3
C.4
D.6
答案:
A
本题知识点:
DROP=选项,类似KEEP=及KEEP语句
参考第6题。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SASBase 认证 考试 70 5160
![提示](https://static.bdocx.com/images/bang_tan.gif)