Sei sulla pagina 1di 5

SASBASECERTIFICATIONQUESTIONSANDANSWERS

PART3OF4
ThefollowingisalistofquestionsthatcanhelpyoutocrackBaseSAScertificationexam.

PreviousTwoParts

Q21.ThefollowingSASprogramissubmitted:
datawork.one
x=3
y=2
z=x**y
run
WhichoneofthefollowingisthevalueofthevariableZintheoutputdataset?
A.6
B.9
C..(missingnumericvalue)
D.Theprogramfailstoexecuteduetoerrors.
Answer:B.
**=exponentiation
X**YraiseXtothepowerofY
So3tothepowerof2=9

Q22.ThefollowingSASprogramissubmitted:
datawork.new
lengthword$7
amount=7

ifamount=5thenword='CAT'
elseifamount=7thenword='DOG'
elseword='NONE!!!'
amount=5
run
WhichoneofthefollowingrepresentsthevaluesoftheAMOUNTandWORDvariables?
A.amountword
5DOG
B.amountword
5CAT
C.amountword
7DOG
D.amountword
7''(missingcharactervalue)
Answer:A.WhenSASreadsintheiterationsinsequence,itfirstwrites7tothevariable'amount'inPDV.
Thenitreadsthroughtheconditionandwrites'DOG'forvariable'word'inPDV.Thenitagainencountersthe
value5andwritesto'Amount'inPDV.

Q23.ThefollowingSASprogramissubmitted:
data_null_
setold
putsales1sales2
run
Whereistheoutputwritten?
A.theSASlog
B.therawdatafilethatwasopenedlast
C.theSASoutputwindoworanoutputfile
D.thedatasetmentionedintheDATAstatement
Answer:A.
Q24.ThefollowingSASprogramissubmitted:
datawork.report
setwork.sales_info
ifqtr(sales_date)ge3
run

TheSASdatasetWORK.SALES_INFOhasoneobservationforeachmonthintheyear2000andthe
variableSALES_DATEwhichcontainsaSASdatevalueforeachofthetwelvemonths.
HowmanyoftheoriginaltwelveobservationsinWORK.SALES_INFOarewrittentotheWORK.REPORT
dataset?
Answer:C.Theqtr(quarter)valuesofeachofthemonths(JulythroughDecember)7,8,9,10,11,12is
3,3,3,4,4,4..Therefore6obsareincludedinthefinaldataset.
Q25.ThefollowingSASDATAstepissubmitted:
datasasdata.atlantasasdata.bostonwork.portlandwork.phoenix
setcompany.prdsales
ifregion='NE'thenoutputboston
ifregion='SE'thenoutputatlanta
ifregion='SW'thenoutputphoenix
ifregion='NW'thenoutputportland
run
Whichoneofthefollowingistrueregardingtheoutputdatasets?
A.Nolibraryreferencesarerequired.
B.ThedatasetslistedonalltheIFstatementsrequirealibraryreference.
C.ThedatasetslistedinthelasttwoIFstatementsrequirealibraryreference.
D.ThedatasetslistedinthefirsttwoIFstatementsrequirealibraryreference.
Answer:D.ThedatasetsinthefirsttwoIFstatementsrequire"sasdata"libref.
Q26.ThefollowingSASprogramissubmitted:
procsortdata=work.employee
bydescendingfname
procsortdata=work.salary
bydescendingfname
datawork.empdata
mergework.employeework.salary
byfname
run
Whichoneofthefollowingstatementsexplainswhytheprogramfailedexecution?
A.TheSORTprocedurescontaininvalidsyntax.
B.ThemergeddatasetsarenotpermanentSASdatasets.
C.Thedatasetswerenotmergedintheorderbywhichtheyweresorted.
D.TheRUNstatementswereomittedaftereachoftheSORTprocedures.

Answer:C.Thetwoprocsortsarearrangedindescendingorder.However,themergeisinascending
order.Hence,thetwodatasetswon'tbemerged.
Inmergeifyouchoosetosortbydescendingthenyoumustusedescendingwithmergestatement
otherwiseitwillnotmergebecauseofreason(C).Itdoesnotmatterifyousortbyascendingorder.
Q27.WhichoneofthefollowingistrueoftheSUMstatementinaSASDATAstepprogram?
A.ItisonlyvalidinconjunctionwithaSUMfunction.
B.ItisnotvalidwiththeSET,MERGEandUPDATEstatements.
C.Itaddsthevalueofanexpressiontoanaccumulatorvariableandignoresmissingvalues.
D.ItdoesnotretaintheaccumulatorvariablevaluefromoneiterationoftheSASDATAsteptothenext.
Answer:C.

Q28.TheSASdatasetsWORK.EMPLOYEEandWORK.SALARYarelistedbelow:
WORK.EMPLOYEE
fnameage
Bruce30
Dan40
Dan25000
WORK.SALARY
fnamesalary
Bruce25000
Bruce35000
ThefollowingSASprogramissubmitted:
datawork.empdata
mergework.employeework.salary
byfname
totsal+salary
run
HowmanyvariablesareoutputtotheWORK.EMPDATAdataset?
A.3
B.4
C.5
D.Novariablesareoutputtothedatasetastheprogramfailstoexecuteduetoerrors.
Answer:B.Thevariablesare:Fname,age,salaryandtotsal.
Note:Obswillnotbecountedhere.

Q29.ThefollowingSASprogramissubmitted:
datawork.sets
dountil(prodgt6)
prod+1
end
run
WhichoneofthefollowingisthevalueofthevariablePRODintheoutputdataset?
A.5
B.6
C.7
D.8
Answer:C.Becauseofprod+1statement,SAScompilerwillassumearetainprod0statement.
Firstloop=>prod=1=>(1gt6)=>false,loopcontinues
Secondloop=>prod=2=>(2gt6)=>false,loopcontinues
.....
lastloop=>prod=7=>(7gt6)=>true,dountilloopexitsandpdvwritesprodvalueof7tooutputdataset.
Q30.Whichofthefollowingisnotanerroridentifiedduringthecompilationphase?
A)Quotationmarksareunbalances
B)NoRUNstatementinthestep
C)Anoptionisinvalid
D)Semicolonsaremissinginstatements
Answer:B.

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

Potrebbero piacerti anche