Hi guys, I have a question about how to keep the name of headers on the same line in Proc report?
I am making a table in proc report statement and my code is :
proc report data=table12 nowindows headline headskip spacing = 10;
columns AVISITN_1 Trt01a count mean_se;
define AVISITN_1/group order=data center width =20 " Test Day " style(column)={just=c};
define Trt01a /display center width=10 "Treatment" ;
define count / display center width =14 "N";
define mean_se /display center width = 40" Adjusted Mean(SE)";
title1 bold "Table11";
title2 bold "Summary od Blood Glucose Level over time";
title3 bold "ITT Subjects";
compute after AVISITN_1;
line " ";
endcomp;
run;
ods pdf close;
And my output is:
My question is that i didn't use the split statement to divide the header and I want to keep "Test Day" and "Adjusted mean(SE)"headers in the same line.
Thanks!
Using Style:
style(header)={nobreakspace=on}
ods pdf file='c:\temp\temp.pdf';
proc report data=sashelp.class nowindows headline headskip spacing = 10 style(header)={nobreakspace=on} ;
columns sex name age weight;
define sex/group order=data center width =20 " Test Day " style(column)={just=c} ;
define name /display center width=10 "Treatment" ;
define age / display center width =14 "N";
define weight /display center width = 40" Adjusted Mean(SE)";
title1 bold "Table11";
title2 bold "Summary od Blood Glucose Level over time";
title3 bold "ITT Subjects";
compute after sex;
line " ";
endcomp;
run;
ods pdf close;
Using Style:
style(header)={nobreakspace=on}
ods pdf file='c:\temp\temp.pdf';
proc report data=sashelp.class nowindows headline headskip spacing = 10 style(header)={nobreakspace=on} ;
columns sex name age weight;
define sex/group order=data center width =20 " Test Day " style(column)={just=c} ;
define name /display center width=10 "Treatment" ;
define age / display center width =14 "N";
define weight /display center width = 40" Adjusted Mean(SE)";
title1 bold "Table11";
title2 bold "Summary od Blood Glucose Level over time";
title3 bold "ITT Subjects";
compute after sex;
line " ";
endcomp;
run;
ods pdf close;
what will the nobreakspace option do? Can anyone help me to understand?
Thank you @Ksharp. Understood now.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.