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 (December 2003, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 19 Dec 2003 01:50:18 -0800
Reply-To:   yma@HAAS.BERKELEY.EDU
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   yma@HAAS.BERKELEY.EDU
Subject:   help on renaming variables in SAS

Hi all, I am working on a big dataset with over 10,000 variables and need some help on renaming variables.

Let's say I have lots lots of variables measured at Time=1 and named as T1age, T1sex, T1cost,........, T1whatever. What I want to do is to get rid of the prefix "T1" from every single variable. That is,

rename T1age=age T1sex=sex T1cost=cost..... T1whatever=whatever;

But because I have so many variables that it's almost impossible for me to edit their names like this. So I need your advice on what is the best way of achieving the goal. I think the solution may lie in macro %substr function in combination with some kind of loop. But I wasn't completely successful. Your help is really appreciated.

-S


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