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;
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};
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;
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};
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.
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.
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.