BookmarkSubscribeRSS Feed
Elliott
Obsidian | Level 7

Is there a way to have all the column headings appear in uppercase on my ods output spreadsheet?

With help from sas communities I have been able to change the font size and make it bold, but now I want them all to appear in uppercase. 

Can that be done?

thank you,

10 REPLIES 10
ballardw
Super User

That may require changing the LABEL of the variables involved or the text in the code generating the output if specifying the headings as part of define or table statements (or similar in other procs).

If you don't want to permanently change a label in a dataset almost every procedure recognizes the label statement as an option.

OS2Rules
Obsidian | Level 7

Hi,

What procedure(s) are you using to create the spreadsheets?  In some, like PROC TABULATE, you can code the column label in the procedure, while others use the LABEL for the variable or the variable name

Ksharp
Super User

You mean change column name or column label ?

Elliott
Obsidian | Level 7

I am using proc template to make a custom format for the font size, type, etc.

I just wanted to make the column label in all uppercase, right now in my code for all my tables I have used uppercase for all variables names but when I output some are still lower case or mixed case.  I just want all the column labels to be in upper case.

This is only for the column labels, not the data in the table.

Thanks,

Ksharp
Super User

I would make a macro or use call execute to rewrite these label again . I am not familiar with proc template , don't know if it have such ability .

Xia Keshan

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

data _null_;

  set sashelp.vcolumn (where=(libname="SASHELP" and memname="BMT")) end=last;

  if _n_=1 then call execute('data work.bmt; set sashelp.bmt; label ');

  call execute(' '||strip(name)||'="'||upcase(strip(label))||'"');

  if last then call execute(';run;');

run;

data_null__
Jade | Level 19

There is no need to replace the entire data set to change the meta data.  That's a big hammer for such a small nail.

aymaliev
Calcite | Level 5
Thank you
Cynthia_sas
SAS Super FREQ

Hi:

  You did not say what kind of template you were using. I assume it is a style template. You can't do a change to upcase in the style template -- with the style template you are changing the style characteristics -- color, font, font-face of the column header -- but you cannot change the value of the header in a style template. While you might be able to make the type of change you want in a tagset template, that is a lot of work. AND, you have to know that your destination of choice even uses TAGSET templates. And, then there would be changing the tagset template, which I wouldn't recommend for something like this.  it is hardly worth it, given the fact that most SAS procedures support the LABEL statement or have internal ways to alter the label -and- the fact that RW9 has provided you a nice bit of code that would, in fact, do what you want.

cynthia

data_null__
Jade | Level 19

You mention variable names.  If your column heading are simply the variable names you might be able to use OPTIONS VALIDVARNAME=UPCASE and achieve your goal.  You would also need OPTIONS NOLABEL if your variables have labels.

options validvarname=any label=0;
proc report nofs data=sashelp.heart(obs=10) list;
  
columns _all_;
   run;
options validvarname=upcase label=0;
proc report nofs data=sashelp.heart(obs=10) list;
  
columns _all_;
   run;
options validvarname=any label=1;

3-20-2015 8-18-16 AM.png

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 10 replies
  • 8895 views
  • 2 likes
  • 8 in conversation