欢迎来到天天文库
浏览记录
ID:7299052
大小:2.43 MB
页数:59页
时间:2018-02-10
《debugging your sas programs》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、CHAPTER10DebuggingYourSASPrograms10.1WritingSASProgramsThatWork27810.2FixingProgramsThatDon’tWork28010.3SearchingfortheMissingSemicolon28210.4Note:INPUTStatementReachedPasttheEndoftheLine28410.5Note:LostCard28610.6Note:InvalidData28810.7Note:MissingValuesWereGenerated29010.8Note:NumericValues
2、HaveBeenConvertedtoCharacter(orViceVersa)29210.9DATAStepProducesWrongResultsbutNoErrorMessage29410.10TheDATAStepDebugger29610.11Error:InvalidOption,Error:TheOptionIsNotRecognized,orError:StatementIsNotValid29810.12Note:VariableIsUninitializedorError:VariableNotFound30010.13SASTruncatesaCharac
3、terVariable30210.14SASStopsintheMiddleofaJob30410.15SASRunsOutofMemoryorDiskSpace306278TheLittleSASBook10.1WritingSASProgramsThatWorkIt’snotalwayseasytowriteaprogramthatworksthefirsttimeyourunit.EvenexperiencedSASprogrammerswilltellyouit’sadelightfulsurprisewhentheirprogramsrunonthefirsttry.T
4、helongerandmorecomplicatedtheprogram,themorelikelyitistohavesyntaxorlogicerrors.Butdon’tdespair,thereareafewguidelinesyoucanfollowthatcanmakeyourprogramsruncorrectlysoonerandhelpyoudiscovererrorsmoreeasily.MakeprogramseasytoreadOnesimplethingyoucandoisdevelopthehabitofwritingprogramsinaneatan
5、dconsistentmanner.Programsthatareeasytoreadareeasiertodebugandwillsaveyoutimeinthelongrun.Thefollowingaresuggestionsonhowtowriteyourprograms:♦PutonlyoneSASstatementonaline.SASallowsyoutoputasmanystatementsonalineasyouwish,whichmaysaveyousomespaceinyourprogram,butthesavedspaceisrarelyworththes
6、acrificeinreadability.♦Useindentiontoshowthedifferentpartsoftheprogram.IndentallstatementswithintheDATAandPROCsteps.ThiswayyoucantellataglancehowmanyDATAandPROCstepsthereareinaprogramandwhichstatementbelongstowhichstep.It’salsohelpfultofurtherindentanystatementsbetweenaDOstatementanditsENDsta
7、tement.♦Usecommentstatementsgenerouslytodocumentyourprograms.Thistakessomedisciplinebutisimportant,especiallyifanyoneelseislikelytoreadoruseyourprogram.Everyonehasadifferentprogrammingstyle,anditisoftenimpossibletofigureoutwhatsomeoneelse’spr
此文档下载收益归作者所有