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

Respected Advisor
Posts: 2,989

Re: Rename multiple variables one datastep

Posted in reply to omega1983

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.

--
Paige Miller
Ask a Question
Discussion stats
  • 1 reply
  • 358 views
  • 1 like
  • 2 in conversation