|Date: ||Fri, 19 Dec 2003 01:50:18 -0800|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.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.....
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.