The SAS Output Delivery System and reporting techniques

how to capitalize the names of variables?

Reply
N/A
Posts: 0

how to capitalize the names of variables?

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
N/A
Posts: 0

Re: how to capitalize the names of variables?

Posted in reply to deleted_user
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.
N/A
Posts: 0

Re: how to capitalize the names of variables?

Posted in reply to deleted_user
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
SAS Super FREQ
Posts: 8,862

Re: how to capitalize the names of variables?

Posted in reply to deleted_user
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
Ask a Question
Discussion stats
  • 3 replies
  • 1777 views
  • 0 likes
  • 2 in conversation