BookmarkSubscribeRSS Feed
shirinkumar_shah
Calcite | Level 5
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.
3 REPLIES 3
Andre
Obsidian | Level 7
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]
shirinkumar_shah
Calcite | Level 5
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
Andre
Obsidian | Level 7
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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1163 views
  • 0 likes
  • 2 in conversation