The SAS Output Delivery System and reporting techniques

Page x of y using ODS ESCAPECHAR

Reply
New Contributor
Posts: 2

Page x of y using ODS ESCAPECHAR

Problem Description:
I'm creating tables using PROC TABULATE and have set up a footnote stating 'Page x of y' using the ODS ESCAPECHAR functionality. 'Page x of y' for each table is independent of the other tables - e.g. if I have 3 tables each of 2 pages, then the footnote will be Page 1 of 2 & Page 2 of 2 for each of the 3 tables.

The resulting tables are output to one PDF file.
I want to maintain the page numbering for each table independent of the others i.e. Page 1 of 2, Page 2 of 2 rather than Page 1 of 6 etc..

Is there a way of resetting the page numbering for each new PROC TABULATE within the ODS PDF statements?
I can reset the current page number using OPTIONS PAGENO=1 in between each PROC TABULATE, but this doesn't solve the resetting of the {lastpage} value.

The code below is just a PROC PRINT of the SASHELP dataset CLASS to get my point across. This has output Page 1 of 2 and Page 2 of 2, but really I would want Page 1 of 1 for the first PROC PRINT and Page 1 of 1 for the second PROC PRINT.
Super Contributor
Posts: 273

Re: Page x of y using ODS ESCAPECHAR

Posted in reply to shirinkumar_shah
Shah
It seems that the of is always aligned with the total number of pages of your entire document
Andre

even with the following try
[pre]
ods rtf file="test.rtf";
title justify=right ' ^{thispage} ';
proc print data=sashelp.class;
run;
options pageno=1;
proc print data=sashelp.class;
run;
options pageno=1;
footnote "proc print ^{pageof} ";;
proc print data=sashelp.class;
run;
ods rtf close;

[/pre]
New Contributor
Posts: 2

Re: Page x of y using ODS ESCAPECHAR

Hi Andre,
Thanks for your quick response, meanwhile i have managed to get what I was looking for in RTF format, but my goal is to gate the same in PDF.
Can you please help me on this.


ods rtf file="C:\section.rtf"contents=yes;
* Create in table page numbering within the document;
ods rtf sectiondata="\pgnrestart\pgnstarts1";
proc print data=sashelp.class ;
title '{Page \field{\*\fldinst { PAGE \\* MERGEFORMAT }}} of {\field
{\*\fldinst SECTIONPAGES \* MERGEFORMAT } in this section}';
run;
proc print data=sashelp.shoes ;
title '{Page \field{\*\fldinst { PAGE \\* MERGEFORMAT }}} of {\field
{\*\fldinst SECTIONPAGES \* MERGEFORMAT } in this section}';
run;

ods rtf close ;

Shirin
Super Contributor
Posts: 273

Re: Page x of y using ODS ESCAPECHAR

Posted in reply to shirinkumar_shah
Shah
rtf internal encoding applies only to rtf
if you get the correct presentation in rtf, you may perhaps
export it directly from Open office or
indirectly from MSWord (with pdf creator printer) to pdf?

Andre
Ask a Question
Discussion stats
  • 3 replies
  • 249 views
  • 0 likes
  • 2 in conversation