SAS 考题 123Word文件下载.docx
《SAS 考题 123Word文件下载.docx》由会员分享,可在线阅读,更多相关《SAS 考题 123Word文件下载.docx(73页珍藏版)》请在冰点文库上搜索。
![SAS 考题 123Word文件下载.docx](https://file1.bingdoc.com/fileroot1/2023-5/2/bf55080f-5c57-4012-b87e-f5b9eebe23c8/bf55080f-5c57-4012-b87e-f5b9eebe23c81.gif)
1
2
ThecontentsoftherawdatafileAMOUNTarelistedbelow:
--------10-------20-------30
$1,234
infile'
amount'
;
input@1salary6.;
if_error_thendescription='
Problems'
elsedescription='
NoProblems'
WhichoneofthefollowingisthevalueoftheDESCRIPTIONvariable?
A.Problems
B.NoProblems
C.'
'
(missingcharactervalue)
D.Thevaluecannotbedeterminedastheprogramfailstoexecuteduetoerrors.
3
ThecontentsoftherawdatafileNAMENUMarelistedbelow:
Joexx
namenum'
inputname$number;
WhichoneofthefollowingisthevalueoftheNUMBERvariable?
A.xx
B.Joe
C..(missingnumericvalue)
4
5
WhichoneofthefollowingisthevalueoftheSALARYvariable?
A.1234
B.1,234
C.$1,234
6
WhichoneofthefollowingstatementsistrueregardingtheSASautomatic_ERROR_variable?
A.The_ERROR_variablecontainsthevalues'
ON'
or'
OFF'
.
B.The_ERROR_variablecontainsthevalues'
TRUE'
FALSE'
C.The_ERROR_variableisautomaticallystoredintheresultingSASdataset.
D.The_ERROR_variablecanbeusedinexpressionsorcalculationsintheDATAstep.
7
WhichoneofthefollowingistruewhenSASencountersadataerrorinaDATAstep?
A.TheDATAstepstopsexecutingatthepointoftheerror,andnoSASdatasetiscreated.
B.AnoteiswrittentotheSASlogexplainingtheerror,andtheDATAstepcontinuestoexecute.
C.AnoteappearsintheSASlogthattheincorrectdatarecordwassavedtoaseparateSASfileforfurtherexamination.
D.TheDATAstepstopsexecutingatthepointoftheerror,andtheresultingDATAsetcontainsobservationsuptothatpoint.
8
datawork.totalsales(keep=monthsales{12});
setwork.monthlysales(keep=yearproductsales);
arraymonthsales{12};
doi=1to12;
monthsales{i}=sales;
end;
ThedatasetnamedWORK.MONTHLYSALEShasoneobservationpermonthforeachoffiveyearsforatotalof60observations.
Whichoneofthefollowingistheresultoftheaboveprogram?
A.Theprogramfailsexecutionduetodataerrors.
B.Theprogramfailsexecutionduetosyntaxerrors.
C.TheprogramexecuteswithwarningsandcreatestheWORK.TOTALSALESdataset.
D.TheprogramexecuteswithouterrorsorwarningsandcreatestheWORK.TOTALSALESdataset.
9ThefollowingSASprogramissubmitted:
datawork.totalsales;
setwork.monthlysales(keep=yearproductsales);
retainmonthsales{12};
doi=1to12;
cnt+1;
monthsales{cnt}=sales;
C.TheprogramrunswithwarningsandcreatestheWORK.TOTALSALESdatasetwith60observations.
D.TheprogramrunswithouterrorsorwarningsandcreatestheWORK.TOTALSALESdatasetwith60observations.
10
datawork.january;
setwork.allmonths(keep=productmonthnum_soldcost);
ifmonth='
Jan'
thenoutputwork.january;
sales=cost*num_sold;
keep=productsales;
WhichvariablesdoestheWORK.JANUARYdatasetcontain?
A.PRODUCTandSALESonly
B.PRODUCT,MONTH,NUM_SOLDandCOSTonly
C.PRODUCT,SALES,MONTH,NUM_SOLDandCOSTonly
D.Anincompleteoutputdatasetiscreatedduetosyntaxerrors.
11
ThecontentsoftherawdatafileCALENDARarelistedbelow:
01012000
calendar'
input@1datemmddyy10.;
ifdate='
01012000'
dthenevent='
January1st'
WhichoneofthefollowingisthevalueoftheEVENTvariable?
A.01012000
B.January1st
12
ASASprogramissubmittedandthefollowingSASlogisproduced:
2datagt100;
3setia.airplanes
4ifmpggt100thenoutput;
22202
ERROR:
FileWORK.IF.DATAdoesnotexist.
FileWORK.MPG.DATAdoesnotexist.
FileWORK.GT.DATAdoesnotexist.
FileWORK.THEN.DATAdoesnotexist.
FileWORK.OUTPUT.DATAdoesnotexist.
ERROR22-322:
Syntaxerror,expectingoneofthefollowing:
aname,
aquotedstring,(,;
END,KEY,KEYS,NOBS,OPEN,POINT,_DATA_,_LAST_,_NULL_.
ERROR202-322:
Theoptionorparameterisnotrecognizedandwillbeignored.
5run;
TheIAlibrefwaspreviouslyassignedinthisSASsession.
WhichoneofthefollowingcorrectstheerrorsintheLOG?
A.DeletethewordTHENontheIFstatement.
B.AddasemicolonattheendoftheSETstatement.
C.PlacequotesaroundthevalueontheIFstatement.
D.AddanENDstatementtoconcludetheIFstatement.
13
ThecontentsoftherawdatafileSIZEarelistedbelow:
7295
size'
input@1height2.@4weight2;
WhichoneofthefollowingisthevalueofthevariableWEIGHTintheoutputdataset?
A.2
B.72
C.95
14
ASASPRINTprocedureoutputoftheWORK.LEVELSdatasetislistedbelow:
Obsnamelevel
1Frank1
2Joan2
3Sui2
4Jose3
5Burt4
6Kelly.
7Juan1
datawork.expertise;
setwork.levels;
iflevel=.then
expertise='
Unknown'
elseiflevel=1then
Low'
elseiflevel=2or3then
Medium'
High'
WhichofthefollowingvaluesdoesthevariableEXPERTISEcontain?
A.Low,Medium,andHighonly
B.Low,Medium,andUnknownonly
C.Low,Medium,High,andUnknownonly
D.Low,Medium,High,Unknown,and'
15
ThecontentsoftherawdatafileEMPLOYEEarelistedbelow:
Ruth3911
Jose3222
Sue3033
John4044
employee'
inputemployee_name$1-4;
ifemployee_name='
Ruth'
theninputidnum10-11;
elseinputage7-8;
WhichoneofthefollowingvaluesdoesthevariableIDNUMcontainwhenthenameoftheemployeeis"
Ruth"
?
A.11
B.22
C.32
16
Sue'
theninputage7-8;
elseinputidnum10-11;
WhichoneofthefollowingvaluesdoesthevariableAGEcontainwhenthenameoftheemployeeis"
Sue"
A.30
B.33
C.40
17
libnamesasdata'
SAS-data-library'
setsasdata.chemists;
ifjobcode='
Chem2'
thendescription='
SeniorChemist'
AvalueforthevariableJOBCODEislistedbelow:
JOBCODE
chem2
WhichoneofthefollowingvaluesdoesthevariableDESCRIPTIONcontain?
A.Chem2
B.Unknown
C.SeniorChemist
D.'
18
chem3'
CHEM3
A.chem3