BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
analyst_work
Obsidian | Level 7

HI,

 

Is there a way to insert a blank page in my report? I tried using the pagebreaks but does not seem to work. Also, is there a way I can customize page numbers? eg. I want the page number as Page1-Comments.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Hi

 

You can use the option STARTPAGE= with your ODS RTF statement to control when new pages are created.

 

There is a way to create empty pages using the Report Writing Interface.

 

To add text to the page numbering, you need to define your own style.

 

See code below for an example:

 

ods path
  (prepend) work.mytemplates (update)
;

proc template;
  define style myrtf;
    parent=styles.rtf;
    class PageNo / 
      pretext="Page "
      posttext=" Comments"
    ;
  end;
run;

ods rtf file="c:\temp\sample.rtf" startpage=never style=myrtf ;
title "page1";

proc print data=sashelp.class;
run;

title;
ods rtf startpage=now;

* 
* tell SAS we create a table, needed so that page gets created
* will generate a warning
*;
data _null_;
  declare odsout xods();
  xods.table_start();
  xods.table_end();
run;



ods rtf startpage=now;
title "page3";

proc sgplot data=sashelp.class;
  vbar age;
run;

title;
ods rtf close;

 

Bruno

View solution in original post

1 REPLY 1
BrunoMueller
SAS Super FREQ

Hi

 

You can use the option STARTPAGE= with your ODS RTF statement to control when new pages are created.

 

There is a way to create empty pages using the Report Writing Interface.

 

To add text to the page numbering, you need to define your own style.

 

See code below for an example:

 

ods path
  (prepend) work.mytemplates (update)
;

proc template;
  define style myrtf;
    parent=styles.rtf;
    class PageNo / 
      pretext="Page "
      posttext=" Comments"
    ;
  end;
run;

ods rtf file="c:\temp\sample.rtf" startpage=never style=myrtf ;
title "page1";

proc print data=sashelp.class;
run;

title;
ods rtf startpage=now;

* 
* tell SAS we create a table, needed so that page gets created
* will generate a warning
*;
data _null_;
  declare odsout xods();
  xods.table_start();
  xods.table_end();
run;



ods rtf startpage=now;
title "page3";

proc sgplot data=sashelp.class;
  vbar age;
run;

title;
ods rtf close;

 

Bruno

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 1 reply
  • 4587 views
  • 0 likes
  • 2 in conversation