<?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: Wide PROC REPORT and Page Numbering in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Wide-PROC-REPORT-and-Page-Numbering/m-p/837602#M331199</link>
    <description>&lt;P&gt;Have you had a look at this post?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Page-number-at-top-and-page-break-after-each-proc-report-entry/td-p/415312" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Page-number-at-top-and-page-break-after-each-proc-report-entry/td-p/415312&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Oct 2022 05:27:11 GMT</pubDate>
    <dc:creator>Norman21</dc:creator>
    <dc:date>2022-10-10T05:27:11Z</dc:date>
    <item>
      <title>Wide PROC REPORT and Page Numbering</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wide-PROC-REPORT-and-Page-Numbering/m-p/833051#M329308</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a trivial question, considering the following dataset (MY_DATASET):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
Variable1 | Variable2 | Variable3 | Variable4&amp;nbsp;| Variable5 | Page | PageNumbering |

----------------------------------------------------------------------------------

xxxx1&amp;nbsp; &amp;nbsp; &amp;nbsp;| AAAAA&amp;nbsp; &amp;nbsp; &amp;nbsp;| YY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | LLL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| W&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 1&amp;nbsp; &amp;nbsp; | Page 1 of 8&amp;nbsp; &amp;nbsp;|
xxxx2&amp;nbsp; &amp;nbsp; &amp;nbsp;| AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | YYY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| LLLLLL&amp;nbsp; &amp;nbsp; | WWWWWWWW&amp;nbsp; | 1&amp;nbsp; &amp;nbsp; | Page 1 of 8&amp;nbsp; &amp;nbsp;|
xxxx3&amp;nbsp; &amp;nbsp; &amp;nbsp;| AAA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| WWW&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 1&amp;nbsp; &amp;nbsp; | Page 1 of 8&amp;nbsp; &amp;nbsp;|
xxxx4&amp;nbsp; &amp;nbsp; &amp;nbsp;| AAAAA&amp;nbsp; &amp;nbsp; &amp;nbsp;| YY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | LLL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| W&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 2&amp;nbsp; &amp;nbsp; | Page 2 of 8&amp;nbsp; &amp;nbsp;|
xxxx5&amp;nbsp; &amp;nbsp; &amp;nbsp;| AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | YYY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| LLLLLL&amp;nbsp; &amp;nbsp; | WWWWWWWW&amp;nbsp; | 2&amp;nbsp; &amp;nbsp; | Page 2 of 8&amp;nbsp; &amp;nbsp;|
xxxx6&amp;nbsp; &amp;nbsp; &amp;nbsp;| AAA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| WWW&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 2&amp;nbsp; &amp;nbsp; | Page 2 of 8&amp;nbsp; &amp;nbsp;|&lt;BR /&gt;...
*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Consider the following PROC REPORT code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=my_dataset headline nowd split="@" missing spacing=1;
  column variable1 variable2 variable3 variable4 variable5;
  by page;

  %* ID Variable(s);
  define variable1 / order order=internal id;
  %* Page 1;
  define variable2 / display;
  define variable3 / display;
  %* Page 2;
  define variable4 / display;
  define variable5 / display;

  compute before _page_;
    line @1 pagenumbering $200.;
  encomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: the code will produce an ODS RTF output. I have left this code off for simplicity.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;As you can see, the code above will produce a "wide" PROC REPORT. What I mean by this, the output will produce two pages for every value of the PAGE variable:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Page 1 of x&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Page=1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;PageNumbering=Page 1 of 8&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Variable1 Variable2 Variable3&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Page 2 of x&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Page=1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;PageNumbering=Page 1 of 8&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Variable1 Variable4 Variable5&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Variable1 being the &lt;STRONG&gt;ID variable&lt;/STRONG&gt; appearing on all pages.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Variable2 and Variable3 appearing on the first page.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Variable4 and Variable5 appearing on the second page.&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The Issue:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The current code will print a line of text above the table on each page via the COMPUTE block. However, as the output is wide the page numbering is repeating, and I know why, but I was curious is there a nice solution, that I do not know about, which will give me the correct page numbering per page.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Page 1 of 16&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Variable1 Variable2 Variable3&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Page 2 of 16&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Variable1 Variable4 Variable5&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Notice the Pagenumbering variable has changed 8 to 16 (due to there are technically 2 pages per page as the output is wide) and that the page number is counting correctly. Note, I have created two new PageNumbering variables, so I have these at my disposal too:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*
Variable1 | Variable2 | Variable3 | Variable4&amp;nbsp;| Variable5 | Page | PageNumbering | PageNumbering1 | PageNumbering2 |
-------------------------------------------------------------------------------------------------------------------------
xxxx1&amp;nbsp; &amp;nbsp; &amp;nbsp;| AAAAA&amp;nbsp; &amp;nbsp; &amp;nbsp;| YY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | LLL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| W&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 1&amp;nbsp; &amp;nbsp; | Page 1 of 8&amp;nbsp; &amp;nbsp;| Page 1 of 16   | Page 2 of 16   |
xxxx2&amp;nbsp; &amp;nbsp; &amp;nbsp;| AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | YYY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| LLLLLL&amp;nbsp; &amp;nbsp; | WWWWWWWW&amp;nbsp; | 1&amp;nbsp; &amp;nbsp; | Page 1 of 8&amp;nbsp; &amp;nbsp;| Page 1 of 16   | Page 2 of 16   |
xxxx3&amp;nbsp; &amp;nbsp; &amp;nbsp;| AAA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| WWW&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 1&amp;nbsp; &amp;nbsp; | Page 1 of 8&amp;nbsp; &amp;nbsp;| Page 1 of 16   | Page 2 of 16   |
xxxx4&amp;nbsp; &amp;nbsp; &amp;nbsp;| AAAAA&amp;nbsp; &amp;nbsp; &amp;nbsp;| YY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | LLL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| W&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 2&amp;nbsp; &amp;nbsp; | Page 2 of 8&amp;nbsp; &amp;nbsp;| Page 3 of 16   | Page 4 of 16   |
xxxx5&amp;nbsp; &amp;nbsp; &amp;nbsp;| AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | YYY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| LLLLLL&amp;nbsp; &amp;nbsp; | WWWWWWWW&amp;nbsp; | 2&amp;nbsp; &amp;nbsp; | Page 2 of 8&amp;nbsp; &amp;nbsp;| Page 3 of 16   | Page 4 of 16   |
xxxx6&amp;nbsp; &amp;nbsp; &amp;nbsp;| AAA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| WWW&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 2&amp;nbsp; &amp;nbsp; | Page 2 of 8&amp;nbsp; &amp;nbsp;| Page 3 of 16   | Page 4 of 16   |&lt;BR /&gt;&lt;CODE class=" language-sas"&gt;...&lt;/CODE&gt; */&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;So Variable2 and Variable3 would use PageNumbering1 and Variable4 and Variable5 would use PageNumbering2.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Things I have already tried (some work):&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Looping the PROC REPORT per page (works but very slow on large datasets)&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Using the ODS RTF ^{this page} stuff (works but when I combine outputs the page numbering is linked to the entire document and not the output itself).&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Any thoughts welcome.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 07:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wide-PROC-REPORT-and-Page-Numbering/m-p/833051#M329308</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2022-09-13T07:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Wide PROC REPORT and Page Numbering</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wide-PROC-REPORT-and-Page-Numbering/m-p/837602#M331199</link>
      <description>&lt;P&gt;Have you had a look at this post?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Page-number-at-top-and-page-break-after-each-proc-report-entry/td-p/415312" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Page-number-at-top-and-page-break-after-each-proc-report-entry/td-p/415312&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 05:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wide-PROC-REPORT-and-Page-Numbering/m-p/837602#M331199</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2022-10-10T05:27:11Z</dc:date>
    </item>
  </channel>
</rss>

