BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Emma_at_SAS
Lapis Lazuli | Level 10

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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.


 

View solution in original post

8 REPLIES 8
ballardw
Super User

The first place to start would likely be the STARTPAGE setting in your ODS Word.

 

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/odsug/p10mxeb6wxqfjgn1p5u0w4t8qf20.htm#p1moj1...

 

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.

Emma_at_SAS
Lapis Lazuli | Level 10

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.

Reeza
Super User

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.


 

Emma_at_SAS
Lapis Lazuli | Level 10

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

FreelanceReinh
Jade | Level 19

@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.
show_option_menu.png

Emma_at_SAS
Lapis Lazuli | Level 10
Thank you, FreelanceReinhard!
ErikDilts
Calcite | Level 5

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.

Reeza
Super User
You're aware that ODS WORD is still pre-production?

SAS Innovate 2025: Register Now

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!

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
  • 8 replies
  • 5087 views
  • 5 likes
  • 5 in conversation