DATA Step, Macro, Functions and more

Rename multiple variables one datastep

Reply
Contributor
Posts: 59

Rename multiple variables one datastep


data test(rename=(rename=('A Category'n=A_Category);  rename=('B Category'n=B_Category)????

set mytable;

run;

I want to change the name of several variables.  Will I need a separate datastep for all?  FOr example I want to rename both A and B Category

Trusted Advisor
Posts: 1,614

Re: Rename multiple variables one datastep

data test(rename=('A Category'n=A_Category 'B Category'n=B_Category));

Or better yet, since you are not performing any tasks in the small data step code other than renaming, use PROC DATASETS to rename your variables.

Ask a Question
Discussion stats
  • 1 reply
  • 176 views
  • 1 like
  • 2 in conversation