How may I remove the page breaks after each PROC?
I found this for ODS RTF but did not find a similar resource for ODS WORD
https://www.lexjansen.com/wuss/2014/51_Final_Paper_PDF.pdf
Thanks
You really need to post your code in the future, it'll help us answer your questions faster.
Startpage is not listed under the options in the ODS WORD documentation so it doesn't go in the options parenthesis, it stays outside. This generates my file with no page breaks and a single page docx file with both tables.
ods word file='/home/fkhurshed/Demo1/example.docx' startpage=no ;
proc print data=sashelp.class (obs=3);
run;
proc print data=sashelp.air(obs=5);
run;
ods word close;
Note separate entries;
OPTIONS (< suboptions>) Specify destination-specific suboptions SASDATE Insert the standard SAS date in the document in place of the default Word date and time field SELECT selection(s) | ALL | NONE Select output objects for the destination. SHOW Write to the SAS Log the current selection or exclusion list for the destination STARTPAGE= YES | NO | NOW | BYGROUP Control the insertion of new pages
@Emma_at_SAS wrote:
Thank you, ballardw.
That is it then! When I add: options(STARTPAGE="NO"), SAS gives me this warning message:
WARNING: Option "startpage" not recognized. This option will be ignored.
WARNING: The ODS WORD destination is preproduction in this release.
I will create RTF and then convert it to WORD.
The first place to start would likely be the STARTPAGE setting in your ODS Word.
Set STARTPAGE=NO and page breaks shouldn't be added.
Lots of caveats though as Word is still preproduction which means that features can be a tad unpredictable.
If you really want the control then use ods rtf and then convert the rtf document to Word.
Thank you, ballardw.
That is it then! When I add: options(STARTPAGE="NO"), SAS gives me this warning message:
WARNING: Option "startpage" not recognized. This option will be ignored.
WARNING: The ODS WORD destination is preproduction in this release.
I will create RTF and then convert it to WORD.
You really need to post your code in the future, it'll help us answer your questions faster.
Startpage is not listed under the options in the ODS WORD documentation so it doesn't go in the options parenthesis, it stays outside. This generates my file with no page breaks and a single page docx file with both tables.
ods word file='/home/fkhurshed/Demo1/example.docx' startpage=no ;
proc print data=sashelp.class (obs=3);
run;
proc print data=sashelp.air(obs=5);
run;
ods word close;
Note separate entries;
OPTIONS (< suboptions>) Specify destination-specific suboptions SASDATE Insert the standard SAS date in the document in place of the default Word date and time field SELECT selection(s) | ALL | NONE Select output objects for the destination. SHOW Write to the SAS Log the current selection or exclusion list for the destination STARTPAGE= YES | NO | NOW | BYGROUP Control the insertion of new pages
@Emma_at_SAS wrote:
Thank you, ballardw.
That is it then! When I add: options(STARTPAGE="NO"), SAS gives me this warning message:
WARNING: Option "startpage" not recognized. This option will be ignored.
WARNING: The ODS WORD destination is preproduction in this release.
I will create RTF and then convert it to WORD.
Thanks, Reeza! Yes, that works!
I do not have the option to change/edit the solution for this question. This would be misleading for future visitors! Any suggestions for that?
Thanks
@Emma_at_SAS wrote:
I do not have the option to change/edit the solution for this question.
Hello @Emma_at_SAS,
You can select a different post as the solution after clicking "Not the Solution" in the option menu (see icon below) of the current solution.
I doubt this changes the solution (which is an imperfect one for me, as I'm limited to DDE for automation and can only save RTF as DOC and I really want DOCX), but this method fails as soon as the second table crosses a page break:
ods word file='example.docx' startpage=no ;
proc print data=sashelp.class (obs=3);
run;
proc print data=sashelp.gcstate(obs=35);
run;
ods word close;
My output from this, running SAS v9.4M6, puts the first table on page 1, an empty page 2, and the second table on pages 3 and 4.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.