Hi, there:
I would like to make only part of headers ("AAAAA" in my example) justified left by using PROC REPORT.
I tried to use inline formatting, but my following code does not generate what I want, remains unchanged (center justified, in default?).
data test;
length column1-column3 $200.;
column1="aaaaa"; column2="bbbbb"; column3="ccccc"; output;
run;
ods rtf file="PleaseSpecifyYourOwnFolder\test.rtf";
proc report data=test nowindows;
column ("(*ESC*){style[fontfamily='Times New Roman' just=left]AAAAA}" column1 ("BBBBB" column2) ("CCCCC" column3));
define column1 / display;
define column2 / display;
define column3 / display;
run;
quit;
ods rtf close;
I have no idea. Please help me.
Thank you in advance.
Try style(header)={just=l} on the proc report line:
proc report data=test nowindows style(header)={just=l};
column ("(*ESC*){style[fontfamily='Times New Roman' just=left]AAAAA}" column1 ("BBBBB" column2) ("CCCCC" column3));
define column1 / display;
define column2 / display;
define column3 / display;
run;
Try style(header)={just=l} on the proc report line:
proc report data=test nowindows style(header)={just=l};
column ("(*ESC*){style[fontfamily='Times New Roman' just=left]AAAAA}" column1 ("BBBBB" column2) ("CCCCC" column3));
define column1 / display;
define column2 / display;
define column3 / display;
run;
Hi, heffo-san:
Your code works.
Thank you.
I have one more question.
I think, your code's style(header)=xx effects overall headers, but result is not (only for top header "AAAAA").
I misunderstand? Any reference info is welcome.
Thank you in advance.
Hi, heffo-san, All:
Sorry, but one problem,
Following your code, almost all headers, "AAAAA"~"CCCCC" are left justified.
I want lower headers, "BBBBB" & "CCCCC" to remain unchanged (i.e., center justified).
Please help me. Thank you in advance.
Could this work:
ods escapechar='^';
ods rtf file="\\FMAWPDFP02\Home$\henrik.forsell\test2.rtf";
proc report data=test nowindows style(header)={just=l};
column ('aaaaa' column1 ('^S={just=c} bbbb' column2) ('^S={just=c} cccc' column3));
define column1 / display;
define column2 / display;
define column3 / display;
run;
quit;
ods rtf close;
heffo-san:
Thanks a lot!!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.