BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
HitmonTran
Pyrite | Level 9

Hello,

 

I am trying to break pages by "trtx" but it's not breaking.  Please help, thank you.

 

 

output:

Untitled.png

 

code:

 

proc sort data= final;
    by trtx usubjid  ;
run;

ods listing close;
ods rtf file = "output.rtf" startpage=no style= TLF_CN_9;
options symbolgen nobyline  orientation=landscape;
 

 title1 j=l "Randomized Treatment: #byval1"; 
 
proc report data = final nowd headline headskip missing split='@' style(header column)=[protectspecialchars=off];
		  by  trtx;
		  columns trtx col:   ;
		  define trtx/order noprint;
		  define col1    	  	/display   style(header)=[just=left]    style(column)=[asis=on cellwidth=1.4 in ] flow "Subject ID/ Age/Race/Sex"; 
		  define col2    	  	/display   style(header)=[just=left]    style(column)=[asis=on cellwidth=.5 in ] flow "Completed@Study"; 
		  define col3    	  	/display   style(header)=[just=left]    style(column)=[asis=on cellwidth=.7 in ] flow "Visit"; 
		  define col4    	  	/display   style(header)=[just=left]    style(column)=[asis=on cellwidth=.9 in ] flow "Date of@Discontinuation@(Day)"; 
          define col5    	  	/display   style(header)=[just=left]    style(column)=[asis=on cellwidth=.9 in ] flow "Date of@Last Dose@of IP@(Day)"; 
		  define col6    	  	/display   style(header)=[just=left]    style(column)=[asis=on cellwidth=2 in ] flow "Primary Reason for Discontinuation from Study"; 

	 	break after trtx/ page;
run;
  
	
ods rtf close;
ods listing;

 

 

sample data:

 

trtxsubjidcol1col2col3col4col5col6
1121901-2012/74/W/MnoDay 02021-01-15 (28)2020-12-18 (0)WITHDRAWAL BY SUBJECT
1131901-2013/74/W/MnoDay 282021-01-15 (28)2021-02-08 (28)WITHDRAWAL BY SUBJECT
1141901-2014/74/W/MyesDay 02021-09-10 (262)2021-02-08 (28)WITHDRAWAL BY SUBJECT
1151901-2015/74/W/MyesDay 282021-09-10 (262)2021-02-08 (28)WITHDRAWAL BY SUBJECT
2221901-2022/74/W/MnoDay 02021-01-15 (28)2021-02-08 (28)WITHDRAWAL BY SUBJECT
2 23 1901-2023/74/W/MnoDay 282021-01-15 (28)2021-02-08 (28)WITHDRAWAL BY SUBJECT
2 24 1901-2024/74/W/MyesDay 02021-09-10 (262)2021-02-08 (28)WITHDRAWAL BY SUBJECT
2 25 1901-2025/74/W/MyesDay 282021-09-10 (262)2021-02-08 (28)WITHDRAWAL BY SUBJECT

 

1 ACCEPTED SOLUTION
5 REPLIES 5
Ksharp
Super User
Since you are using "by trtx;" , there are no need "break after trtx/ page;" , you can remove it ,sas will automatically break page after trtx.

Or remove NOPRINT option to check what happened .
define trtx/order noprint;
-->
define trtx/order ;
HitmonTran
Pyrite | Level 9
still doesn't work. do you think it might be a template issue?
Cynthia_sas
SAS Super FREQ
Hi:
The SAS style template does not have any impact on BREAK processing (except for colors and fonts) -- so the break not working can't be blamed on a style template. Generally, however, no one can run your code because although you sent some sample data, you didn't send the style template for anyone to use. Also, in your code, you're using some very odd spacing which makes it hard to read the code. Also, it looks like you're mixing ODS STYLE overrides and options like HEADLINE, HEADSKIP and FLOW with style overrides like ASIS=ON -- I don't find the need to use ASIS=ON much anymore since the reason for using it in the "old" days was to ensure indenting when lines were padded with leading spaces. But now with the INDENT= and LEFTMARGIN= style overrides, I just find it easier to use those options instead of padding a variable with spaces. Also, the only reason I know of for using protectspecialchars=off is when you are using RTF control strings in your data to insert raw RTF strings into your output -- but those RTF control strings should be visible in your sample data and I don't see any RTF control strings in your data, so I suspect we are not seeing everything.
Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1631 views
  • 2 likes
  • 4 in conversation