SAS base 50题 训练题(含答案及解析)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

SAS认证考试样题SAS中文论坛网站:datawork.family;infile'file-specification';insertINPUTstatementhererun;WhichINPUTstatementcorrectlyreadsthevaluesforthevariableBirthdateasSASdatevalues?a.inputrelation$first_name$birthdatedate9.;b.inputrelation$first_name$birthdatemmddyy8.;c.inputrelation$first_name$birthdate:date9.;d.inputrelation$first_name$birthdate:mmddyy8.;Correctanswer:dAninformatisusedtotranslatethecalendardatetoaSASdatevalue.Thedatevaluesareintheformoftwo-digitvaluesformonth-day-year,sotheMMDDYY8.informatmustbeused.Whenusinganinformatwithlistinput,thecolon-formatmodifierisrequiredtocorrectlyassociatetheinformatwiththevariablename.Youcanlearnabout•informatsinReadingDateandTimeValues•thecolon-formatmodifierinReadingFree-FormatData.2.Arawdatafileislistedbelow.1---+----10---+----20---+---Jose,47,210Sue,,108ThefollowingSASprogramissubmittedusingtherawdatafileaboveasinput:dataemployeestats;insertINFILEstatementhereinputname$ageweight;run;Thefollowingoutputisdesired:nameageweightJose47210Sue.108WhichofthefollowingINFILEstatementscompletestheprogramandaccessesthedatacorrectly?a.infile'file-specification'pad;b.infile'file-specification'dsd;SAS认证考试样题SAS中文论坛网站=',';d.infile'file-specification'missover;Correctanswer:bThePADoptionspecifiesthatSASpadvariablelengthrecordswithblanks.TheMISSOVERoptionpreventsSASfromreadingpasttheendofthelinewhenreadingfreeformatteddata.TheDLM=optionspecifiesthecommaasthedelimiter;however,consecutivedelimitersaretreatedasonebydefault.TheDSDoptioncorrectlyreadsthedatawithcommasasdelimitersandtwoconsecutivecommasindicatingamissingvaluelikethoseinthisrawdatafile.Youcanlearnabout•thePADoptioninReadingRawDatainFixedFields•theMISSOVERoptioninCreatingMultipleObservationsfromaSingleRecord•theDLM=optionandtheDSDoptioninReadingFree-FormatData.3.Thefollowingprogramissubmitted:datanumrecords;infilecardsdlm=',';inputagent1$agent2$agent3$;cards;jones,,brownjones,spencer,brown;run;WhatisthevalueforthevariablenamedAgent2inthesecondobservation?a.brownb.spencerc.''(missingcharactervalue)d.Thereisnovaluebecauseonlyoneobservationiscreated.Correctanswer:dTheCARDSstatementenablesyoutoreadinstreamdata.AnynumberofconsecutivecommasareconsideredtobeasingledelimiterasaresultoftheDLM=option,andthelengthofeachvariabledefaultsto8bytes.Therefore,thevaluesjones,brownjon,andspencerareassignedtoAgent1,Agent2,andAgent3,respectively,forthefirstobservation.TherestofthedataontherecordisnotreadbytheINPUTstatementandisnotoutputtothedataset.Youcanlearnabout•theCARDSstatementinCreatingSASDataSetsfromRawData•thedefaultlengthofvariablesinReadingFree-FormatData.SAS认证考试样题SAS中文论坛网站:datawork.houses;infile'file-specification';insertINPUTstatementhererun;WhichoneofthefollowingINPUTstatementsreadstherawdatafilecorrectly?a.input@1style$8.+1sqfeet4.+1bedrooms1.@20baths3.street16.@40pricedollar8;b.input@1style$8+1sqfeet4.+1bedrooms1.@20baths3.street$16@40pricedollar8.;c.input@1style$8.+1sqfeet4.+1bedrooms1.@20baths3.street$16.@40pricedollar8.;d.input@1style$8.+1sqfeet4.+1bedrooms1.@20baths3street16.@40pricedollar8.;Correctanswer:cFormattedinputrequiresperiodsaspartoftheinformatname.TheperiodismissingfromthevariablesStyleandStreetinAnswerb,thevariableBathsinAnswerd,andthevariablePriceinAnswera(whichisalsomissingadollarsigntoreadthevariableStreetasacharactervalue).YoucanlearnaboutformattedinputandinformatsinReadingRawDatainFixedFields.5.ThefollowingSASprogramissubmittedatthestartofanewSASsession:libnamesasdata'SAS-data-library';datasasdata.sales;setsasdata.salesdata;profit=expenses-revenues;run;SAS认证考试样题SAS中文论坛网站=sales;run;TheSASdatasetSasdata.Salesdatahastenobservations.Whichoneofthefollowingexplainswhyareportfailstogenerate?a.TheDATAstepfailsexecution.b.TheSASdatasetSalesdoesnotexist.c.TheSASdatasetSaleshasnoobservations.d.ThePRINTprocedurecontainsasyntaxerror.Correctanswer:bTheDATAstepcreatesapermanentSASdataset,Sasdata.Salesdata.ThePRINTprocedureisprintingatemporarySASdataset,Sales,thatisstoredintheWorklibrary.AtthebeginningoftheSASsession,Work.Salesdoesnotexist.Youcanlearnabout•creatingpermanentdatasetswiththeDATAstepinCreatingSASDataSetsfromRawData•temporarydatasetsinBasicConcepts.6.WhichactionassignsareferencenamedSALEStoapermanentSASdatalibrary?a.Issuingthecommand:librefSALES'SAS-data-library'b.Issuingthecommand:libnameSALES'SAS-data-library'c.Submittingthestatement:librefSALES'SAS-data-library';d.Submittingthestatement:libnameSALES'SAS-data-librar

1 / 29
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功