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
Pyrite | Level 9

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

 

- Dr. Abhijeet Safai

Dr. Abhijeet Safai
Associate Data Analyst
Actu-Real

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!

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.

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
  • 6 replies
  • 18809 views
  • 3 likes
  • 6 in conversation