资源描述:
《Using the DATASETS Procedure》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、SUGI31Coders’CornerPaper032-31UsingtheDATASETSProcedureDavidFickbohmHomegaininc.EmeryvilleCAABSTRACTThepurposeofthispaperistoexplainwhy,andhowtousethedatasetsprocedure.Datasetsisaverypowerfulprocedure.Itisnotusedasmuchasitcould/shouldbeused.Thispaperwillcoverthebasicconceptsandsyntaxofthedat
2、asetsprocedure.Theinstructionsthatmanipulatedatafiles;age,append,change,copy,delete,exchange,and,savewillbepresented.Thispaperwillcovertheinformationalinstructionscontents.Finallytheauditinstructionswillbediscussed.INTRODUCTIONWhyisthedatasetsprocedurenotusedasmuchasotherprocedures?Onereason
3、isthatthreeoftheolderSAS®procedures-Copy,Contents,andAppend-werearoundbeforeprocdatasets.Peoplelearnedthosethreeandstuckwiththem.Whyusethedatasetsprocedureinsteadofseveralprocedures?Datasetsismoreefficient,moreversatile,andhasfeaturesfarbeyondcopy,contents,andappend.Usingthedatasetsprocedure
4、letsyouremember,becomeproficient,andrelyononeprocedureratherthanwastebrainstorageandtimeworkingwiththree.Thispaperwilltrytoexplainwhy,when,andhowtousethedatasetsprocedure.BASICIDEAASASdatasetcontainsdescriptorinformationanddatavalues.SASdatafilescanbenativefilescreatedbySASorinterfaceSASfile
5、s,thosecreatedbyothersoftware(oracle,DB2,etc.)butreferencedbyaSASengine.SASviewsholdonlydescriptors.AllofthesecanbemodifiedbyProcdatasets.ASASlibraryisacollectionofoneormoreSASfiles.Thesefilescanbecalledmembers.Membersorfiles,theyarerecognizedbytheSASSystemandarereferencedandstoredasaunit.Ea
6、chlibraryisassociatedwithaSASlibraryengine;thisisthesoftwareinterfacebetweenSASandalibrary.ProcdatasetsreadsandchangesinformationaboutSASdatasetswithoutactuallychangingthedata.ThismakesProcdatasetsmuchmoreefficientthanthedatastepwhichmustreadeachrecordin,whetherornotitwillbechanged,inorderto
7、makechangestothedescriptorinformation.Procdatasetsallowsrungroupprocessing,meaningyoucanstartaprocedureandhavethecommandsexecutewithoutendingit.Commandscanbestackedupandexecutedtogether.Anerrorinonecommandstopsprocessingforallremainingstatements.Yo