<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PAGE NUMBERING in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/297757#M16843</link>
    <description>&lt;P&gt;Hi Barbara,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a paper that talks about how to create page numbers with ods output. &lt;A href="http://support.sas.com/resources/papers/proceedings11/263-2011.pdf" target="_self"&gt;http://support.sas.com/resources/papers/proceedings11/263-2011.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is an example of how to create them as a title. The code is as follows using the ods escapechar option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTIONS NONUMBER;
ODS ESCAPECHAR='^';
title justify=center 'Data Set CLIPS'
 justify=right 'Page ^{pageof}'; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Hopefully this helps you out.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2016 14:09:07 GMT</pubDate>
    <dc:creator>howarder</dc:creator>
    <dc:date>2016-09-12T14:09:07Z</dc:date>
    <item>
      <title>PAGE NUMBERING</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/297729#M16841</link>
      <description>&lt;P&gt;I need to create a pdf and a rtf file with two kind of numbering:&lt;/P&gt;
&lt;P&gt;the page number respect to the entire document and&lt;/P&gt;
&lt;P&gt;the page number respect to the table (for the tables that last more than 1 page).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that possible? how to deal with this in the report code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barbara Pomili&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 12:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/297729#M16841</guid>
      <dc:creator>COMPAREMISSING</dc:creator>
      <dc:date>2016-09-12T12:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: PAGE NUMBERING</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/297757#M16843</link>
      <description>&lt;P&gt;Hi Barbara,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a paper that talks about how to create page numbers with ods output. &lt;A href="http://support.sas.com/resources/papers/proceedings11/263-2011.pdf" target="_self"&gt;http://support.sas.com/resources/papers/proceedings11/263-2011.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is an example of how to create them as a title. The code is as follows using the ods escapechar option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTIONS NONUMBER;
ODS ESCAPECHAR='^';
title justify=center 'Data Set CLIPS'
 justify=right 'Page ^{pageof}'; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Hopefully this helps you out.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 14:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/297757#M16843</guid>
      <dc:creator>howarder</dc:creator>
      <dc:date>2016-09-12T14:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: PAGE NUMBERING</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/297886#M16854</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;I think the challenge that the OP will ultimately face is that the usual {thispage} and {lastpage} ESCAPECHAR functions only work with the page numbering for the total number of pages in the document (not the number of pages relative to each table. (BTW, {pageof} only works for RTF, not for PDF, but {thispage} and {lastpage} work for both RTF and PDF destinations.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; That means for page x of y -- x is the current page and y is the number of pages in the entire document. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; For example, in the code below, multiple pages are printed for SASHELP.HEART and SASHELP.SHOES and you can see at the "change" between the procedures that it was possible to reset the starting value for {thispage} but not for the ending value of {lastpage}.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here's the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title; footnote;
ods escapechar='^';

options pageno=1;
ods rtf file='c:\temp\multpages.rtf';
ods pdf file='c:\temp\multpages.pdf';

title j=c "SASHELP.HEART" j=r 'Page ^{thispage} of ^{lastpage}';
proc print data=sashelp.heart(obs=100);
  var sex status ageatstart diastolic systolic;
run;
title;
 
options pageno=1;
ods rtf;
ods pdf;

title j=l 'Page ^{thispage} of ^{lastpage}' j=c "SASHELP.SHOES";

proc print data=sashelp.shoes(obs=150);
  var region product sales inventory;
run;

ods _all_ close;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the output (top output is PDF, bottom output is RTF):&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4901i3A6735CA564C733F/image-size/original?v=v2&amp;amp;px=-1" alt="using_page_numbering.png" title="using_page_numbering.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 01:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/297886#M16854</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-09-13T01:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: PAGE NUMBERING</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/785122#M25500</link>
      <description>Thanks.</description>
      <pubDate>Thu, 09 Dec 2021 10:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/785122#M25500</guid>
      <dc:creator>DrAbhijeetSafai</dc:creator>
      <dc:date>2021-12-09T10:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: PAGE NUMBERING</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/787969#M25527</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18102"&gt;@COMPAREMISSING&lt;/a&gt;&amp;nbsp;, a short answer to your question is YES.&amp;nbsp; But according to the SAS export&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;, you would not have a SAS solution in any time soon (I can be wrong).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand your motivation for this project, and the good news is that the method is out there for quite a long time.&amp;nbsp; Here is an example for you to start, using a modified program from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;, and a short description of the method is in a &lt;SPAN&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4936-2020.pdf" target="_self"&gt;SAS Global Forum 2020&lt;/A&gt;&amp;nbsp;paper.&amp;nbsp; &amp;nbsp;Good Luck and Happy New Year!&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title; footnote;
ods escapechar='^';

data heart; set sashelp.heart(obs=100);
pg=1+floor(_n_/35); 

data shoes; set sashelp.shoes(obs=150);; 
pg=1+floor(_n_/35); 

options pageno=1;
ods rtf file='~/sasout/multpages.rtf';

title j=c "SASHELP.HEART" j=r 'Page ^{thispage} of ^{lastpage}' j=l 'PAGE_X_OF_Y';
proc  report data=heart; 
  col pg sex status ageatstart diastolic systolic;
  define pg /order order=internal noprint;
  break after pg/page;
run;
title;
 
title j=l 'Page ^{thispage} of ^{lastpage}' j=c "SASHELP.SHOES" j=r 'PAGE_X_OF_Y'; 
proc report data=shoes;
  col pg region product sales inventory;
  define pg /order order=internal noprint;
  break after pg/page;
run;

ods _all_ close;
title;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Jan 2022 04:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PAGE-NUMBERING/m-p/787969#M25527</guid>
      <dc:creator>Jianmin</dc:creator>
      <dc:date>2022-01-01T04:37:13Z</dc:date>
    </item>
  </channel>
</rss>

