LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 18 Aug 2008 23:52:48 GMT
Reply-To:   Lou <lpogoda@VERIZON.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Lou <lpogoda@VERIZON.NET>
Subject:   Re: how to improve this code
Comments:   To: sas-l@uga.edu

"Bucher Scott" <SBucher@SCHOOLS.NYC.GOV> wrote in message news:98634D42B37B2E4E96CF3A3BD3CD9AE60242526D@EX1VS2.nyced.org... > Hi Jeff, > > In 9.2, I believe you can refer to series of datasets is a similar > fashion to variables. So the following may work: > > Data all; > Merge var001-var219; > By id; > Run; > > If you do not have 9.2, a macro could do the job. > %macro merge_series; > data all; > %do i = 1 %to 219; > var%sysfunc(putn(&i, z3.)); > %end; > ; > by id; > run; > %mend merge_series; > %merge_series >

Using a macro doesn't change, let alone improve, the code - if you turn mprint on you'll see the list of datasets in all its glory - it just makes it more obsure.


Back to: Top of message | Previous page | Main SAS-L page