<?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 counter in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Page-counter/m-p/159511#M41607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You question is a very complex one, and there are several papers out there.&amp;nbsp; You have to take into consideration font size, page orientation, width/height, style, line wrapping etc. And then it might not work.&amp;nbsp; If you just want page numbers then for RTF/PDF you can use:&lt;/P&gt;&lt;P&gt;ods escapechar= "^";&lt;/P&gt;&lt;P&gt;footnote j=r "Page ^{thispage} of ^{lastpage}";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way pages are automatically generated for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or the way I tend to do things, generate the output once, look at it and decide that maybe I want ten observations per page:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pgno=floor(_n_/10)+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And use pgno as my break on / page in the proc report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Sep 2014 14:24:24 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-09-25T14:24:24Z</dc:date>
    <item>
      <title>Page counter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Page-counter/m-p/159510#M41606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to count how many observations fit on page in proc report. How to compute variable pagenum (e.g.) which consists page number?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logic of this procedure (in pseudocode) is following:&lt;/P&gt;&lt;P&gt;L - number of rows per page&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pagenum = 1&lt;/P&gt;&lt;P&gt;counter = 0&lt;/P&gt;&lt;P&gt;for observation in dataset:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #go through all observations in dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter += HowManyRows(observation)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #HowManyRows function returns number of rows which observation deposite on page&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if counter &amp;lt;= L*pagenum then:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pagenum&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #write value pagenum into pagenum variable in datastep&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pagenum = pagenum + 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #write value pagenum into pagenum variable in datastep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to write similar logic in SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end I'll obtain datastep with pagenum variable and I can write line statments before every page. Last question: does this line shift page content by 1 row and the last page row transfers to the next page?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 14:12:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Page-counter/m-p/159510#M41606</guid>
      <dc:creator>S_Proskurnin</dc:creator>
      <dc:date>2014-09-25T14:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Page counter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Page-counter/m-p/159511#M41607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You question is a very complex one, and there are several papers out there.&amp;nbsp; You have to take into consideration font size, page orientation, width/height, style, line wrapping etc. And then it might not work.&amp;nbsp; If you just want page numbers then for RTF/PDF you can use:&lt;/P&gt;&lt;P&gt;ods escapechar= "^";&lt;/P&gt;&lt;P&gt;footnote j=r "Page ^{thispage} of ^{lastpage}";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way pages are automatically generated for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or the way I tend to do things, generate the output once, look at it and decide that maybe I want ten observations per page:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pgno=floor(_n_/10)+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And use pgno as my break on / page in the proc report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 14:24:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Page-counter/m-p/159511#M41607</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-25T14:24:24Z</dc:date>
    </item>
  </channel>
</rss>

