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.
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!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: