The SAS Output Delivery System and reporting techniques

'ods rtf startpage = now' does not work

Accepted Solution Solved
Reply
Contributor sm4
Contributor
Posts: 22
Accepted Solution

'ods rtf startpage = now' does not work

Hello,

I am trying to force page breaks but the ods rtf startpage= now statement doesn't seem to be working. This is a simplified version of my code:

ods rtf file = "hello.rtf" style= styles.hello startpage= yes; *(tried =on too);
	ods escapechar = '^';
	options nodate nonumber;

	ods rtf text= "hello &hello.";

	ods rtf startpage= now;

	ods rtf text= "hello &hello.";

ods rtf close;



Everything is on the same page in the output rtf.

Probably I'm doing something stupid but would appreciate if someone can point it out.

 

Thanks!!


Accepted Solutions
Solution
Wednesday
Super User
Posts: 21,478

Re: 'ods rtf startpage = now' does not work

I would use a data set and proc print to push text or PROC ODSTEXT but when I last tested it, it has the same issues as ODS TEXT. 

 

View solution in original post


All Replies
Super User
Posts: 21,478

Re: 'ods rtf startpage = now' does not work

ODS TEXT statements don't get processed until they encounter a run or quit so that's likely your issue - with your test, not the functionality of STARTPAGE. Try doing this with PROC PRINT instead.

 

%let hello = Reeza;

ods rtf file = "hello.rtf" style=meadow startpage=no; *(tried =on too);
	ods escapechar = '^';
	options nodate nonumber;

	ods rtf text= "hello &hello.";
    proc print data=sashelp.class;
    run;

	ods rtf startpage= now;

	ods rtf text= "hello &hello.";
    proc print data=sashelp.air (obs=10);
    run;

ods rtf close;
Contributor sm4
Contributor
Posts: 22

Re: 'ods rtf startpage = now' does not work

Thanks very much for your response!
I can't test this idea out till I have access to SAS again on Monday, but
wanted to clarify first - does this mean I can't force page breaks if I
only want to use text= statements? I see you didn't change the text=
statement itself, so it looks like there isn't a way to use it alone.

Thanks again for your time!
Solution
Wednesday
Super User
Posts: 21,478

Re: 'ods rtf startpage = now' does not work

I would use a data set and proc print to push text or PROC ODSTEXT but when I last tested it, it has the same issues as ODS TEXT. 

 

Contributor sm4
Contributor
Posts: 22

Re: 'ods rtf startpage = now' does not work

I see. I guess another way is to add the right number of spaces you need to
force a page break.
Will test out on Monday and follow up here.

Thanks!
Super User
Posts: 21,478

Re: 'ods rtf startpage = now' does not work

Or use/force in RTF tags is another option. 

Contributor sm4
Contributor
Posts: 22

Re: 'ods rtf startpage = now' does not work

By tags do you mean control words? If so, I don't see any option for page
breaks. And actually I've never been able to get control words to work at
all.
(Sorry, still teaching myself all this)

Thanks!
Contributor sm4
Contributor
Posts: 22

Re: 'ods rtf startpage = now' does not work

Proc odstext does solve the page break issue for me Smiley Happy

But it brings up text justification issues Smiley Sad Will start a new thread for that, I guess.

Contributor sm4
Contributor
Posts: 22

Re: 'ods rtf startpage = now' does not work

This code works as expected, tried with a blank dataset. I guess I can use this as a workaround by trying to make the dataset invisible, if that's possible. Will keep fiddling and update here.

 

Thanks!

Super User
Posts: 12,148

Re: 'ods rtf startpage = now' does not work

You might want to investigate using Proc ODSTEXT instead of ODS RTF Text. The output doesn't depend quite so much on another procedure creating ODS output as ODS RTF TEXT seems to.

Contributor sm4
Contributor
Posts: 22

Re: 'ods rtf startpage = now' does not work

Will check this out and update here.

Thanks!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 10 replies
  • 251 views
  • 1 like
  • 3 in conversation