欢迎来到天天文库
浏览记录
ID:39517051
大小:236.89 KB
页数:11页
时间:2019-07-04
《don't be a SAS dinosaur》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、SASGlobalForum2009FoundationsandFundamentalsPaper143-2009®Don'tBeaSASDinosaur:ModernizingProgramswithBaseSAS9.2EnhancementsWarrenRepoleJr.,SASInstituteInc.ABSTRACTNewfeaturesoftheSAS®programminglanguageoftenpermitthereplacementofcomplexalgorithmsandclunkyworkaroundswithmoreelega
2、ntcode.Someenhancementssupportthecreationofmoreefficientsolutions.WhetheryouareaSASprogrammerwithmanyyearsofexperienceoranoviceuserwhoisresponsibleformaintaininglegacyprograms,implementingupdatedapproachescanallowyoutostreamlineyourSASapplications,expeditethedevelopmentanddebugg
3、ingprocess,andminimizefuturemaintenanceofthecode.INTRODUCTIONThispapercoversaselectionofenhancementsimplementedinSAS9.2,includingnewfeaturesofBaseSASprocedures,theDATAstep,functions,formats,andthemacrolanguage.EachenhancementispairedwithanalternativetechniqueavailablepriortoSAS9
4、.2.Thisallowsforcomparisonofolderandnewerapproaches.TheprimarymotivationforexploitingSAS9.2enhancementsistheabilitytocreaterobustyeteasy-to-maintainSASprogramswithlessprogrammereffort.Efficiencygainsintermsofmachineresourcesmightbeachieved,buttheyareofsecondaryimportanceinmostex
5、amples.BASESASPROCEDURESPROCPRINT:BLANKLINE=OPTIONInsertingablanklineintoPROCPRINToutputaftereverynobservationscouldenhancereadability,butthiswasdifficulttoaccomplishpriortoSAS9.2.Observationswithmissingvalueswereinserted,theMISSING=systemoptionwasswitchedtoablank(thenresettoits
6、defaultvalueafterward),andtheNOOBSoptionwasrequired.InSAS9.2producingthistypeofreportissimpleusingtheBLANKLINE=optioninthePROCPRINTstatement.dataclass_blanks(drop=i);setsashelp.class;output;ifmod(_n_,5)=0;arrayalln{*}_numeric_;arrayallc{*}_character_;doi=1todim(alln);alln{i}=.;e
7、nd;procprintdata=sashelp.classdoi=1todim(allc);allc{i}="";end;blankline=5;output;run;run;optionsmissing="";procprintdata=class_blanksnoobs;run;optionsmissing=".";Figure1a.Figure1b.PROCPRINTcodebeforeSAS9.2PROCPRINTcodewithBLANKLINE=option1SASGlobalForum2009FoundationsandFundamen
8、talsObsNameSexAgeHeightWeight1AlfredM1469.0112.
此文档下载收益归作者所有