SAS Macro: rename all variables in a data set
16 March 2011
Here is a SAS Macro to rename all variables in a data set. This macro was adapted from WENSUI’S BLOG IN STATISTICAL COMPUTING.
You can add a prefix, a suffix or both to variable names and you can either keep the same data set with the new variable names or create a new one.
Download: SAS Macro Rename 3.0.sas
Any improvement of this macro is very welcome.
How to use Rename macro:
%Rename(
Dataset : name of the data set
Out= : name of the new data set; if left blank no new data set is created
Prefix= : string that is added as prefix; if left bank, no prefix is added
Suffix= : string that is added as sufffix; if left bank, no suffix is added
If you have any problems to upload or to open it, send me an email.
Advertisement