BookmarkSubscribeRSS Feed
msg
Calcite | Level 5 msg
Calcite | Level 5
This is regarding the alignment of column headers in the proc report.

Is there any option to center align column header and left align the column value?

The define statement, when given with "left" option also left aligns its column header to left.

Thanks
6 REPLIES 6
andreas_lds
Jade | Level 19
Maybe the paper "Beyond the Basics: Advanced PROC REPORT Tips and Tricks" has the answer to your question. It can be found at http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf
msg
Calcite | Level 5 msg
Calcite | Level 5
Thanks andreas_Ids.

But this paper doesn't contain any info/options about aligning the column header to left/center/right.

For Ex.

proc report data=sample_data nowd;
column ('Employee ID' id) ('Employee Name' name);
define id / display right;
display name / display left;
run;

This code will make, not only the column values to right & left, but also the headers..... But, i want the header to be unaffected.

Thanks
Cynthia_sas
SAS Super FREQ
Hi:
For ODS destinations that support style (NOT the LISTING destination), you can specify separate alignment:
[pre]
define name / display
style(header)={just=c}
style(column)={just=l};
[/pre]

You'd have to try this in your ODS destinations of interest. For ODS RTF, PDF and HTML, the STYLE= overrides should work. For destinations like ODS CSV and others, the alignment overrides might not work. The STYLE= overrides are will NOT work for LISTING output (what you see in the Results Window).

cynthia
thummala
Obsidian | Level 7

Hi,

 

Is there an option that I can use to allign the column header to left in the .txt file that is generated using proc report.

 

for example:

 

proc report data=abc  options;

column var1 ("left text"  var2 var3 var4 var5) var6;

[/pre]

 

I want the output to look like

 

                  left text________________

var1           var2     var3     var4    var5      var6

 

 

 

Thank You.

Artem
Calcite | Level 5

column var1 ("(*ESC*)S={just = left}left text(*ESC*)S={}"  var2 var3 var4 var5) var6;

DrAbhijeetSafai
Lapis Lazuli | Level 10

These things are known most of the times, but ready reference here is really helpful! Thank you.

 

- Dr. Abhijeet Safai

Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 6 replies
  • 21033 views
  • 4 likes
  • 6 in conversation