SASBase认证考试70题5160Word格式文档下载.docx
- 文档编号:16389201
- 上传时间:2022-11-23
- 格式:DOCX
- 页数:10
- 大小:52.37KB
SASBase认证考试70题5160Word格式文档下载.docx
《SASBase认证考试70题5160Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《SASBase认证考试70题5160Word格式文档下载.docx(10页珍藏版)》请在冰豆网上搜索。
setWORK.SALARY;
byDepartment;
ifFirst.Department
thenTotal=0;
Total=sum(Total,Wagerate);
ifLast.Total;
WhatistheinitialvalueofthevariableTotal?
A.0
B.Missing
C.ThevalueofthefirstobservationsWagerate
D.Cannotbedeterminedfromtheinformationgiven
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
一般,SAS每读一遍DATA步的所有语句,PDV清空所有所有变量值,并设置为缺失值。
再执行INPUT语句或赋值语句,再次对变量赋值。
如果在DATA步中使用RETAIN语句,不会清空RETAIN对应的变量,保留到该变量下次再次被执行。
Q55
dataWORK.DATE_INFO;
X="
01Jan1960"
D;
VariableXcontainswhatvalue?
A.thenumericvalue0
B.thecharactervalue"
C.thedatevalue01011960
D.thecodecontainsasyntaxerroranddoesnotexecute.
日期时间的表示格式
起点:
1960年1月1日0时0分0秒。
若将日期时间标示为数值型常数,需使用相应格式。
格式值带单引号,后紧跟跟一个D(日期)、T(时间)、DT(日期时间)。
在表示为数值常数时,不支持MMDDYYw.格式,支持datew.格式。
本题,答案C,是因为X="
中D之前有个空格。
若改为X="
D;
,答案就是A。
01011960"
,答案就是D。
Q56
ThefollowingoutputiscreatedbytheFREQUENCYprocedure:
TheFREQProcedure
Tableofregionbyproduct
region
product
Frequency|
Percent
|
RowPct
ColPct
|corn
|cotton
|oranges|
Total
---------+--------+--------+--------+
EAST
|
2|
1|
4
22.22|
11.11|
44.44
50.00|
25.00|
25.00|
33.33|
50.00|
SOUTH
5
55.56
40.00|
20.00|
66.67|
Total
4
3
2
9
44.44
33.33
22.22
100.00
WhichTABLESstatementwasusedtocompletedthefollowingprogramthatproducedtheoutput?
procfreqdata=sales;
<
_insert_code_>
A.tablesregionproduct;
B.tablesregion,product
C.tablesregion/product;
D.tablesregion*product;
PROCFREQ过程
参考第47题。
Q57
GiventheSASdatasetWORK.ONE:
N
BeginDate
-
---------
1
09JAN2010
12JAN2010
dataWORK.TWO;
setWORK.ONE;
Day=<
formatBeginDatedate9.;
ThedatasetWORK.TWOiscreated,whereDaywouldbe1forSunday,2forMonday,3forTuesday,...:
WORK.TWO
N
BeginDate
Day
---------
---
09JAN2010
1
12JAN2010
WhichexpressionsuccessfullycompletedtheprogramandcreatesthevariableDay?
A.day(BeginDate)
B.weekday(BeginDate)
C.dayofweek(BeginDate)
D.getday(BeginDate,today())
日期时间函数
WEEKDAY(date)返回SAS日期值为一周的第几天
Q58
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'
Whydoestheprogramfail?
A.ThePAGENOoptionisinvalidintheOPTIONSstatement.
B.TheRUNstatementismissingaftertheFORMATprocedure.
C.TheformatnamecontainsaperiodintheVALUEstatement.
D.TheLABELoptionismissingfromthePROCPRINTstatement.
C
FORMAT语句、PROCFORMAT过程
参考第9题。
Q59
GiventhecontentsoftherawdatafileTYPECOLOR.DAT:
----+----10---+----20---+----30
daisyyellow
dataFLOWERS;
infile'
TYPECOLOR.DAT'
truncover;
length
Type$5
Color$11;
input
Type$
Color$;
WhatarethevaluesofthevariablesTypeandColor?
A.Type=daisy,Color=yellow
B.Type=daisy,Color=w
C.Type=daisy,Color=daisyyellow
D.Type=daisy,Color=
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
3KL8BY
6.39
125
15
DY65DW
5.60
45
DGTY23
34.55
67
dataWORK.REVENUE(drop=SalesReturnsPrice);
setWORK.PRODUCTS(keep=ProdIdPriceSalesReturns);
Revenue=Price*(Sales-Returns);
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)