Help using Base SAS procedures

How do you page break between 2 ODS Test lines

Reply
Contributor
Posts: 37

How do you page break between 2 ODS Test lines

Is there a way to page break between 2 ods text lines with out using a space line?

 

ods text = The school has 300 students.

 

PAGE BREAK

 

ods text = A new study shows..

Super User
Posts: 13,498

Re: How do you page break between 2 ODS Test lines

Posted in reply to nirali514

Which ODS destination are you sending the output to?

HTML doesn't actually quite do "pages", XML or spreadsheets it is more "sheet" than page.

 

If you are sending the output to ODS RTF (or tagsets.rtf) or PDF you can use the ODS Escapechar coupled with the style element RAW to send the appropriate RTF or PDF code to insert a page break where desired.

If you only want a couple of blank lines then escapechar and the NEWLINE function allows specifying a number of new lines, Newline 3 would create two blank lines.

 

You may also want to investigate the procedure ODSTEXT where the P statement creates a paragraph of text and one or more P statements with no text creates blank lines.

Contributor
Posts: 37

Re: How do you page break between 2 ODS Test lines

I am using rtf.

 

Do you have an example of using ODS Escapechar coupled with the style element RAWbetween two ods text lines?

 

Thank you!

Super User
Posts: 23,663

Re: How do you page break between 2 ODS Test lines

Posted in reply to nirali514

I was hoping PageBREAK in PROC ODSTEXT would accomplish this, but no go. I think one of the main issues is you need an intermediary proc between them to make sure things work well. 

 

This also doesn't work as I would have expected Smiley Sad

ods rtf file='C:\_localdata\temp\output2.rtf' style=meadow startpage=no ;;

proc odstext pagebreak=on;
   p 'You can use the ODSTEXT procedure to add paragraphs
      and lists to your output.';
   p 'You can also format your text.' / style=[color=red fontsize=25pt];
   p 'This slide shows output created by PROC GMAP.' 
                                     / style=[color=purple fontsize=30pt];
run;




proc odstext;
   p 'You can use the ODSTEXT2 procedure to add paragraphs
      and lists to your output.';

run;


ods rtf close;
Super User
Posts: 13,498

Re: How do you page break between 2 ODS Test lines

Posted in reply to nirali514

nirali514 wrote:

I am using rtf.

 

Do you have an example of using ODS Escapechar coupled with the style element RAWbetween two ods text lines?

 

Thank you!


This approach will not work with ODS RTF as the text is placed into tables and apparently the function will not successfully place a page break in the middle of a table. However ODS Tagsets.Rtf allows options to not set ODS text into a table. Also note that each of the ODS Text has the destination: ODS tagsets.RTF. Otherwise the "generic" ODS Text handler seems to ignore the rtf specific raw function.

 

ods escapechar='^' ;

ods tagsets.rtf file='d:\junk.rtf'
 options(Tables_OFF='USERTEXT');

ods tagsets.rtf text='example of forced page break in rtf ^{raw\page} in the middle of text';
proc print data=sashelp.class (obs=1) ;
run;
ods tagsets.rtf text='example of forced page break in rtf between ods text statments';
ods tagsets.rtf text='^{raw \page} ';
ods tagsets.rtf text='following text statement';
ods tagsets.rtf close;

Super User
Super User
Posts: 9,599

Re: How do you page break between 2 ODS Test lines

Posted in reply to nirali514

Just adding, if you want multiple lines of text to appear on multiple pages, or above tables, then would not titles be better suited?  With some style information, left aligning, bodytitle option etc. you can get lines of text above tables just like ods text without the faff of that. 

Ask a Question
Discussion stats
  • 5 replies
  • 196 views
  • 0 likes
  • 4 in conversation