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

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;

 

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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 704 views
  • 0 likes
  • 4 in conversation