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!!
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.
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;
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.
Or use/force in RTF tags is another option.
Proc odstext does solve the page break issue for me 🙂
But it brings up text justification issues 😞 Will start a new thread for that, I guess.
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!
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.
Will check this out and update here.
Thanks!
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.