DATA Step, Macro, Functions and more

How to Change Variable name

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 94
Accepted Solution

How to Change Variable name

Hello,

I need a help changing the Variable name from upper case to Lower case, but not the values in that column. I have more than 200 columns and one of them needs to be in lower case instead of upper case. Example ( TOTAL_COUNT  to total_count) I only have the dataset available. 

 

Thanks for looking.


Accepted Solutions
Solution
‎05-01-2018 12:27 PM
Super User
Posts: 6,628

Re: How to Change Variable name

Posted in reply to Kalai2008

Have you tried:

 

data want;

retain total_count;

set have;

run;

View solution in original post


All Replies
Solution
‎05-01-2018 12:27 PM
Super User
Posts: 6,628

Re: How to Change Variable name

Posted in reply to Kalai2008

Have you tried:

 

data want;

retain total_count;

set have;

run;

Frequent Contributor
Posts: 94

Re: How to Change Variable name

Posted in reply to Astounding

Awesome !Thank you so much..It worked !

PROC Star
Posts: 1,566

Re: How to Change Variable name

Posted in reply to Kalai2008
proc contents data =have out=_have;
run;

proc sql;
select lowcase(name) into : name separated by ' '
from _have;
quit;

data want;
retain &name;
set have;
run;
Frequent Contributor
Posts: 94

Re: How to Change Variable name

[ Edited ]
Posted in reply to novinosrin

Thank you so much.. It worked

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 146 views
  • 0 likes
  • 3 in conversation