资源描述:
《02-getting-your-data-into-sas》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、The Little SAS Book: A Primer, Fifth EditionChapter2:GettingYourDataintoSAS"Practiceisthebestofallinstructors".PubliusSyrus,Circa42B.C"Wealllearnedbydoing,byexperimenting(andoftenfailing),andbyaskingquestions".JayJacobWindFromBartlett'sFamiliarQuotations13thedition,by
2、JohnBartlett,copyright1955byLittleBrown&Company.Publicdomain.FromtheSASLListserv,March15,1994.Reprintedbypermissionoftheauthor.2.1MethodsforGettingYourDataintoSASDatacomeinmanydifferentforms.Yourdatamaybehandwrittenonapieceofpaper,ortypedintoarawdatafileonyourcomputer
3、.Perhapsyourdataareinadatabasefileonyourpersonalcomputer,orinadatabasemanagementsystem(DBMS)onthemainframecomputeratyouroffice.Whereveryourdatareside,thereisawayforSAStousethem.Youmayneedtoconvertyourdatafromoneformtoanother,orSASmaybeabletouseyourdataintheircurrentfo
4、rm.ThissectionoutlinesseveralmethodsforgettingyourdataintoSAS.Mostofthesemethodsarecoveredinthisbook,butafewofthemoreadvancedmethodsaremerelymentionedsothatyouknowtheyexist.WedonotattempttocoverallmethodsavailableforgettingyourdataintoSAS,asnewmethodsarecontinuallybei
5、ngdeveloped,andcreativeSASuserscanalwayscomeupwithclevermethodsthatworkfortheirownsituations.Butthereshouldbeatleastonemethodexplainedinthisbookthatwillworkforyou.MethodsforgettingyourdataintoSAScanbeputintofourgeneralcategories:nenteringdatadirectlyintoSASdatasetsncr
6、eatingSASdatasetsfromrawdatafilesnconvertingothersoftware'sdatafilesintoSASdatasetsnreadingothersoftware'sdatafilesdirectlyNaturally,themethodyouchoosewilldependonwhereyourdataarelocated,andwhatsoftwaretoolsareavailabletoyou.EnteringDataDirectlyintoSASDataSetsSometime
7、sthebestmethodforgettingyourdataintoSASistoenterthedatadirectlyintoSASdatasetsthroughyourkeyboard.nTheViewtablewindow,discussedinsection2.2,isincludedwithBaseSASsoftware.Viewtableallowsyoutoenteryourdatainatabularformat.Youcandefinevariables,orcolumns,andgivethemattri
8、butessuchasname,length,andtype(characterornumeric).nSASEnterpriseGuidesoftware,whichisincludedwithBaseSASforWindows,hasadata