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 (January 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 28 Jan 2009 15:33:37 -0500
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: Rename more than One variable at time
Comments: To: "Subhu. Manyam" <proccontents@GMAIL.COM>

Why not just:

data want; set have (rename=(Mark1-Mark32=HW1-HW32)); run;

HTH, Art ------ On Wed, 28 Jan 2009 14:47:10 -0500, SAS_learner <proccontents@GMAIL.COM> wrote:

>Hello guys, > >I give I tried but not where I am doing wrong like yesterday today I was >trying to do something that would save me few key strokes ( actually more >than that) . Today I need to rename couple of variable say Mark1 -- to >Mark32 to HW1 -- HW32 . for that I tried something like this > >Proc Sql Noprint ; >Select Max (mx_count ) into : max_count >From >(select visit, count(Smpbot) as mx_count > From Smp Group By Pt, Cennbr, sbjnbr, visit, actevent, Dadtc); >; >Select name into : var1- Var&max_count. >from dictionary.columns >where lowcase(libname) = "work" and lowcase(memname) = "dadtc" >and lowcase(name) like "mark%"; >Quit ; >Proc Datasets Library = Work ; > Modify dadtc ; > Rename > do i = 1 to &max_count ; >&&var&i = HW&&var.&i.; >end ; >Quit; >Run;


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