BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SanKH1
Quartz | Level 8

Hi,

We want to produce a table where the first column header is aligned to the left but the second column header is centered. I have this code and I don't know how to change it to get the display I want. How can you modify? I am not familiar with proc report.

proc report data= dsin nowd missing split = '~'
style(report)={frame=box}
style(header)={font=('Times New Roman', 8 pt) just=center background=lightgrey}
style(column)={font=('Times New Roman', 8 pt) just=left};
column label sample;
define label / display "This is a header" style(column)={just=left cellwidth = 12.0 cm asis=on};
define sample / display "sample" style(column)={just=center cellwidth = 3 cm};
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19
define label / display "This is a header" style(column)={just=left cellwidth = 12.0 cm asis=on};
define sample / display "sample" style(column)={just=center cellwidth = 3 cm};

Try this. Remove the location qualifier (column) from your style overrides in the DEFINE statement. 

 

define label / display "This is a header" style={just=left cellwidth = 12.0 cm asis=on};
define sample / display "sample" style={just=center cellwidth = 3 cm};

View solution in original post

5 REPLIES 5
A_Kh
Lapis Lazuli | Level 10

You should use style (header)= attributes in the define statements (which is individual) and remove justifications from the proc report statement (which is general).

 

proc report data= dsin nowd missing split = '~'
style(report)={frame=box}
style(header)={font=('Times New Roman', 8 pt) background=lightgrey}
style(column)={font=('Times New Roman', 8 pt) };
column label sample;
define label / display "This is a header" style(header)= {just=left} style(column)={just=left cellwidth = 12.0 cm asis=on};
define sample / display "sample" style(header)= {just=center} style(column)={just=center cellwidth = 3 cm};
run;

 

SanKH1
Quartz | Level 8
Thank you for replying!
data_null__
Jade | Level 19
define label / display "This is a header" style(column)={just=left cellwidth = 12.0 cm asis=on};
define sample / display "sample" style(column)={just=center cellwidth = 3 cm};

Try this. Remove the location qualifier (column) from your style overrides in the DEFINE statement. 

 

define label / display "This is a header" style={just=left cellwidth = 12.0 cm asis=on};
define sample / display "sample" style={just=center cellwidth = 3 cm};
ballardw
Super User

Not a very clear description of what you want. Do actually want the second column centered or not?

Hard to test code without data.

 

You can override procedure level settings in the Display statement:

define label / display "This is a header" style(column)={just=left cellwidth = 12.0 cm asis=on}
                                          style(header)={just=left}
;

for example changes  the HEADER setting for Label to left justify leaving other settings alone.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 258 views
  • 0 likes
  • 4 in conversation