Sei sulla pagina 1di 7

SASBASECERTIFICATIONQUESTIONSandANSWERS

PART2OF4
ThefollowingisalistofquestionsthatcanhelpyoutocrackBaseSAScertificationexam.

PreviousPart:Part1:SASBaseCertificationQuestionsandAnswers
Q11.WhichoneofthefollowingSASstatementsrenamestwovariables?
A.setwork.dept1work.dept2(rename=(jcode=jobcode)(sal=salary))
B.setwork.dept1work.dept2(rename=(jcode=jobcodesal=salary))
C.setwork.dept1work.dept2(rename=jcode=jobcodesal=salary)
D.setwork.dept1work.dept2(rename=(jcodejobcode)(salsalary))
Answer:B.ThesyntaxforRENAMEisasfollows:
RENAME=(oldname1=newname1oldname2=newname2...oldnamen=newnamen)

Q12.Arawdatarecordisshownbelow:
07Jan2002
WhichoneofthefollowinginformatswouldreadthisvalueandstoreitasaSASdatevalue?
A.date9.
B.ddmonyy9.
C.ddMMMyy9.
D.ddmmmyyyy9.
Answer:A

Q13.Whatdoesdata_null_mean?
data_null_

Thisstatementproduces:
A.noSASdataset
B.aSASdatasetnamednull
C.aSASdatasetnamed_null_
D.thelargestpossibledataset
Answer:A.Thedata_null_doesnotproduceadataset.
Itisusedmainlyforthefollowingpurposes:
1.Tocreatemacrovariableswithcallsymput
2.TocreatecustomizedreportswithPUTstatementswritingtoexternalfiles.

Q14.ThefollowingSASprogramissubmitted:
data_null_
setold(keep=prodsales1sales2)
file'filespecification'
putsales1sales2
run
Whichoneofthefollowingdefaultdelimitersseparatesthefieldsintherawdatafilecreated?
A.:(colon)
B.(space)
C.,(comma)
D.(semicolon)
Answer:B.Sincenodelimiterisspecifiedattheendofthe"file",thedefaultdelimiterspacewillbeused.
Q15.WhichoneofthefollowingstatementsistrueregardingthenameofaSASarray?
A.Itissavedwiththedataset.
B.Itcanbeusedinprocedures.
C.ItexistsonlyforthedurationoftheDATAstep.
D.Itcanbethesameasthenameofavariableinthedataset.
Answer:C.
Q16.TheSASDATA.BANKSdatasethasfiveobservationswhenthefollowingSASprogramissubmitted:
libnamesasdata'SASdatalibrary'
dataallobs
setsasdata.banks
capital=0
doyear=2000to2020by5
capital+((capital+2000)*rate)
output

end
run
HowmanyobservationswilltheALLOBSdatasetcontain?
A.5
B.15
C.20
D.25
Answer:D.Bankshas5observationsandthenthedoloopoutputsfor(20/5+1)times.Therefore5*(20/5
+1)=25istheobservationcount.

Q17.ThefollowingSASSORTprocedurestepgeneratesanoutputdataset:
procsortdata=sasuser.housesout=report
bystyle
run
Inwhichlibraryistheoutputdatasetstored?
A.WORK
B.REPORT.
C.HOUSES
D.SASUSER
Answer:A.Iflibrarynameisnotspecifiedthenthedatawillbestoredintemporarydataseti.e.WORK.

Q18.TheSASdatasetnamedWORK.TESTislistedbelow:

WhichoneofthefollowingSASprogramscreatedthisdataset?
A.
datawork.test
capacity=150
if100lecapacityle200then
airplanetype='Large'andstaff=10
elseairplanetype='Small'andstaff=5
run

B.
datawork.test
capacity=150
if100lecapacityle200then
do
airplanetype='Large'
staff=10
end
else
do
airplanetype='Small'
staff=5
end
run
C.
datawork.test
capacity=150
if100lecapacityle200then
do
airplanetype='Large'
staff=10
else
do
airplanetype='Small'
staff=5
end
run
D.
datawork.test
capacity=150
if100lecapacityle200then
airplanetype='Small'
staff=5
else
airplanetype='Large'
staff=10
run
Answer:B.TheproblemwiththeoptionsA,CandDishighlightedbelowinbold.
A.datawork.test
capacity=150
if100lecapacityle200then

airplanetype='Large'andstaff=10
elseairplanetype='Small'andstaff=5
run
Log:NOTE:Variablestaffisuninitialized.

C.datawork.test
capacity=150
if100lecapacityle200then
do
airplanetype='Large'
staff=10
else/*endmissingforifdoloop*/
do
airplanetype='Small'
staff=5
end
run
Log:ERROR117185:Therewas1unclosedDOblock.
NOTE:TheSASSystemstoppedprocessingthisstepbecauseoferrors.
D.datawork.test
capacity=150
if100lecapacityle200then
airplanetype='Small'
staff=5
else/*thereisnoifassociatedwiththiselse*/
airplanetype='Large'
staff=10
run
Log:ERROR160185:NomatchingIFTHENclause
Q19.ThefollowingSASprogramissubmitted:
datawork.flights
destination='CPH'
select(destination)
when('LHR')city='London'
when('CPH')city='Copenhagen'
otherwise

end
run
WhichoneofthefollowingisthevalueoftheCITYvariable?
A.London
B.Copenh
C.Copenhagen
D.''(missingcharactervalue)
Answer:B.
NoticethattheLENGTHstatementintheSELECTgrouphasnotbeenspecified.Rememberthatwithoutthe
LENGTHstatement,valuesforGroupmightbetruncated,asthefirstvalueforGroup(London)isnotthe
longestpossiblevalue.
city='London'Itcontains6characters.
'Copenhagen'willbetruncatedto6charactersi..eCopenh.
Q20.Arawdatafileislistedbelow:
102030
JohnMcCloskey3571
JuneRosesette1043
TinekeJones937
ThefollowingSASprogramissubmittedusingtherawdatafileasinput:
datawork.homework
infile'filespecification'
inputname$ageheight
ifageLE10
run
HowmanyobservationswilltheWORK.HOMEWORKdatasetcontain?
A.0
B.2
C.3
D.Nodatasetiscreatedastheprogramfailstoexecuteduetoerrors.
Answer:C.Thedatasethomeworkwillhavemissingvaluesundertheagevariable.Thenamehasablank
initsoweneedtousethe&listmodifiertoreadthedata,alsowhenusingthiswehavetomakesurethat
thedataareatleasttwospacesapart.
AsSASconsidersmissingvaluessmallerthan10inagevariablesoithasincludedallthethreeobservation
inthedataset.
Thecorrectedcodeisasfollows:
Datahomewo

inputfname$lname$ageheight
ifageLE10
datalines
JohnMcCloskey3571
JuneRosesette1043
TinekeJones937

run
PrevPart:Part1:SASBaseCertificationQuestionsandAnswers
NextPart:Part3:SASBaseCertificationQuestionsandAnswers

ItsYourTurn!
Ifyouwantmetokeepwritingthissite,pleasepostyourfeedbackinthecommentboxbelow.WhileIlove
havingfriendswhoagree,Ionlylearnfromthosewhodon't.Tohiremeforservicesoradvertising,you
maycontactmeatdeepanshu.bhalla@outlook.com

Potrebbero piacerti anche