BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I'am new to sas. I have a datasets in wich the names of the variables are mix case (upper and lowercase). Because i have more than 300 variables I'am tring to capitalize them without the use of the list of all the names ( as would be the case in the RENAME function). Is there any alternate way i can do so ?

thanks for your help
3 REPLIES 3
deleted_user
Not applicable
Are you capitalizing for the sake of capitalizing (or uncapitalizing), or do you need a single-case list of variable names for another purpose?

SAS variable name usage is not case-sensitive, so it functionally does not matter what case they're in. If you need it for another purpose, however, here's something...

Let's say your dataset is called "stuff."

proc contents data = stuff out = stuffout;
run;

data stuffout;
set stuff;
vari = upcase(name);
keep vari;
run;

In the end, "stuffout" contains one variable, vari, which holds a list of variable names in all uppercase.
deleted_user
Not applicable
Thanks for your answer Elayne,

I know that case does not matter because sas is not case sensitive. But I still want to capitalize the variable names (not to get a single-case list of variable names as you are suggesting). I will export this data set later to another software and it is important to have the variable names capitalized.

thank you for your help
Cynthia_sas
SAS Super FREQ
Rufin:
If you want to "officially" capitalize the names of the variables in the descriptor portion of the SAS dataset prior to exporting the file for use with another product, you need to check out PROC DATASETS documentation, especially the MODIFY and the RENAME statements. You could use the list from Elayne's suggestion as input to your PROC DATASETS step. Your best bet might be to contact SAS Tech Support, as this is not really an ODS question, but a SAS programming and usage question.
cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 5505 views
  • 0 likes
  • 2 in conversation