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 (July 2001, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 26 Jul 2001 08:18:45 -0400
Reply-To:     Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject:      Re: Another Renaming variable issue

Try the following: %macro ren(ds=work.test); %let anzi=0; %let anze=0; %let lib=%scan(&ds,1,"."); %let mem=%scan(&ds,2,"."); data a; retain anzi 0 anze 0; set sashelp.vcolumn; where libname=upcase(scan("&ds",1,".")) and memname=upcase(scan("&ds",2,".")); if upcase(name)=:"I" then do; anzi+1; call symput("ni"!!compress(put(anzi,5.)),name); call symput("anzi",anzi); end; if upcase(name)=:"E" then do; anze+1; call symput("ne"!!compress(put(anze,5.)),name); call symput("anze",anze); end; run; proc datasets lib=&lib nolist; modify &mem; rename %do i=1 %to &anzi; &&ni&i=i&i %end; %do i=1 %to &anze; &&ne&i=e&i %end; ; run; quit; %mend;


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