BookmarkSubscribeRSS Feed
deleted_user
Not applicable
In proc report and rtf ODS, is there a way wherein I can allign each column header (Left, Right or center). I know the style (header) gives us the option to allign all the coulmn headers, but not individual coulmn headers.

I am using the following syntax for style (header) and defining columns. I would like to left allign only the column header _NAME_ .


style(header)={BOTTOMMARGIN = 0IN cellheight=.15in font_face= "Times New Roman" font_size=9pt background=_undef_ font_weight= medium textalign=left}

columns PAGEIT PLAN PARA OR VISIT1 P CL _NAME_ ("^R/RTF'\brdrb\brdrs\brdrw1'Placebo &VAR2 |" Placebo CPLAC) EMPTY ("^R/RTF'\brdrb\brdrs\brdrw1'SB-5090 &VAR3|" _60_mg C60MG) ;
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
STYLE(HEADER) in the PROC REPORT statement will impact ALL column headers on the report output. But you can also use STYLE(HEADER) on a DEFINE statement in order to impact just one variable's header.

In the code below, I set OUTPUTWIDTH=100% so you can see the impact of the different justification options. Note how I can justify the individual headers separately from the data cells. Also, note how HEIGHT and WEIGHT use the default header justification in the absence of any other instructions on a DEFINE statement.

cynthia
[pre]
ods listing close;
ods rtf file='c:\temp\align_hdr.rtf';

proc report data=sashelp.class nowd
style(header)={just=c}
style(report)={outputwidth=100%};
column name sex age height weight;
define name / 'The Name'
style(header)={just=r}
style(column)={just=c};
define sex / 'Gender'
style(header)={just=l}
style(column)={just=r};
define age / 'Age'
style(header)={just=r}
style(column)={just=l};
run;

ods rtf close;
[/pre]

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 3450 views
  • 0 likes
  • 2 in conversation