<?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: Adding page number in SAS table in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Adding-page-number-in-SAS-table/m-p/160957#M41906</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, what do you mean?&amp;nbsp; Page numbers are normally calculated by Word in the footnote by using:&lt;/P&gt;&lt;P&gt;footnote1 j=r "Page ^{thispage} of ^{lastpage}";&lt;/P&gt;&lt;P&gt;This is easier than calculating it your self.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If however you have to have page numbers in the data then you would need to do:&lt;/P&gt;&lt;P&gt;Work out how many pages there will be once rendered - this may not be the same as you think bearing in mind word wrapping/style/borders page size/line size etc.&amp;nbsp; Then you add that info into your data and output per any other data.&amp;nbsp; With graphs for instance it may be easy:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set graph parameters;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('footnote1 j=r "Page '||strip(put(_n_,best.))||' of ||'strip(put(tot,best.))'||";');&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For tables and listings you could be in for whole mess of coding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Aug 2014 10:10:34 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-08-14T10:10:34Z</dc:date>
    <item>
      <title>Adding page number in SAS table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-page-number-in-SAS-table/m-p/160956#M41905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inside a statistical report (rtf file), I would like to add the page number in SAS tables: it's useful in tables which are split in more pages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 10:02:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-page-number-in-SAS-table/m-p/160956#M41905</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2014-08-14T10:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding page number in SAS table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-page-number-in-SAS-table/m-p/160957#M41906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, what do you mean?&amp;nbsp; Page numbers are normally calculated by Word in the footnote by using:&lt;/P&gt;&lt;P&gt;footnote1 j=r "Page ^{thispage} of ^{lastpage}";&lt;/P&gt;&lt;P&gt;This is easier than calculating it your self.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If however you have to have page numbers in the data then you would need to do:&lt;/P&gt;&lt;P&gt;Work out how many pages there will be once rendered - this may not be the same as you think bearing in mind word wrapping/style/borders page size/line size etc.&amp;nbsp; Then you add that info into your data and output per any other data.&amp;nbsp; With graphs for instance it may be easy:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set graph parameters;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('footnote1 j=r "Page '||strip(put(_n_,best.))||' of ||'strip(put(tot,best.))'||";');&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For tables and listings you could be in for whole mess of coding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 10:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-page-number-in-SAS-table/m-p/160957#M41906</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-08-14T10:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding page number in SAS table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-page-number-in-SAS-table/m-p/160958#M41907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. I'm referring to the number in red in the file attacched (example_sas.doc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 11:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-page-number-in-SAS-table/m-p/160958#M41907</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2014-08-14T11:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Adding page number in SAS table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-page-number-in-SAS-table/m-p/160959#M41908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, not sure what proc output that's generated from but myself I would do:&lt;/P&gt;&lt;P&gt;report to rtf with:&lt;/P&gt;&lt;P&gt;ods escapechar='^';&lt;/P&gt;&lt;P&gt;footnote1 j=r "Page ^{thispage}";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then print the rtf to pdf.&amp;nbsp; You could however go directly to PDF with the same syntax.&amp;nbsp; Me, I would also put a breaking section in the report to get a clean break.&amp;nbsp; So:&lt;BR /&gt;data mydata;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set mydata;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain pge;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_=1 then pge=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_ = 20 then pge=pge+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc report data=mydata;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columns pge ...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; define pge / order noprint;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break after / pge;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 11:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-page-number-in-SAS-table/m-p/160959#M41908</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-08-14T11:53:38Z</dc:date>
    </item>
  </channel>
</rss>

