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

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:

Screenshot 2023-12-26 at 7.44.53 PM.png

 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! 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

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;

Ksharp_0-1703641099611.png

 

View solution in original post

5 REPLIES 5
Ksharp
Super User

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;

Ksharp_0-1703641099611.png

 

angird1990
Calcite | Level 5

what will the nobreakspace option do? Can anyone help me to understand?

 

Ksharp
Super User
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p14xegao6xt0xnn1865r422tpytw.htm#n0q3uys...

And I quoted:
To help prevent unexpected wrapping of long text strings when using PROC REPORT with the ODS RTF destination, set NOBREAKSPACE=OFF in a location that affects the LINE statement. The NOBREAKSPACE=OFF attribute must be set in the PROC REPORT code either on the LINE statement or on the PROC REPORT statement where style(lines) is specified.
Ksharp
Super User
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsadvug/p1pt77toue3iyun0z4l9gth5as9f.htm

And I quoted:
NOBREAKSPACE=ON | OFF
specifies how to handle space characters in table cells.
ON
does not let SAS break a line at a space character.
OFF
lets SAS break a line at a space character if appropriate.
Valid in Markup family, Excel, printer family, and RTF destinations

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 909 views
  • 4 likes
  • 3 in conversation