<?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: ODS PDF - last page number by group variable in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-last-page-number-by-group-variable/m-p/96936#M9547</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are many pagexofy macros floating around since before ODS. But you might want to open a track with Tech Support. The cleanest option is to make a separate PDF for every BY group and use the SAS system option to start at 1 with the page numbers. Then use some PDF "combiner" software to manually combine the separate group files into 1 big file or multiple files. The dummy page break variable is also a tried and true method, but you may not be able to make the page numbering cooperate the way you want with that approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Aug 2013 22:45:49 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2013-08-01T22:45:49Z</dc:date>
    <item>
      <title>ODS PDF - last page number by group variable</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-last-page-number-by-group-variable/m-p/96934#M9545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been trying to output a data with several groups into a single PDF which has several group IDs. I need to print the data by group ID and also everytime group ID changes , page should start at page 1.&amp;nbsp; I need a foot note as page 1 of 10 where 10 is the last page of that group in group ID and not the total number of pages in PDF.&amp;nbsp; I used page ~{startpage} of ~{lastpage} in the footnte where ~ is escapechar and options pageno=1 before proc report. this gives me page numebr 1 at the start of each group but last page gives me the total number of pages in PDF instead of last page of that particular group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example: group1 - I need footnote page 1 of 10, 2 of 10 etc.. if there are 10 pages in that group.&lt;/P&gt;&lt;P&gt;&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; group2 - foot note must be 1 of 5, 2of 5 etc.. if there are 5 pages in group2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what I am getting right now is page 1 of 15, 2of 15 etc.. for group1 and when group2 starts it is page 1 of 15, 2of 15 etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached my sample output in PDF and sas code in txt file. Appreciate your inputs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 16:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-last-page-number-by-group-variable/m-p/96934#M9545</guid>
      <dc:creator>dtirumalasetti</dc:creator>
      <dc:date>2013-08-01T16:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: ODS PDF - last page number by group variable</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-last-page-number-by-group-variable/m-p/96935#M9546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chang C. Chung has published a paper called "Page X of Y with Proc Report" (&lt;A href="http://changchung.com/download/pageXofY_draft.pdf"&gt;http://changchung.com/download/pageXofY_draft.pdf&lt;/A&gt;) that details a macro method of doing this. You should be ablet to adapt the macro (starts on page 3) to work with your by groups.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another option would be to figure out the number of rows that will fit on one page, and then create a separate "numpages" var for each by group (increment by one whenever the count of obs for a bygroup exceeds the number of rows that will fit on a page). The obvious disadvantage of this approach is that it is dependent on set font sizes, spacing, page sizes, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yet another option would be to output a separate PDF file for each by group, which would require moving your ods pdf file statement inside the do block. Example (fictional variable called dummy used for illustration):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro pdfrep;&lt;BR /&gt;%do i=1 %to &amp;amp;tot.;&lt;BR /&gt;&amp;nbsp; options pageno=1;&lt;BR /&gt;&amp;nbsp; ods pdf file="sample&amp;amp;&amp;amp;grpid&amp;amp;i. .pdf" notoc ;&lt;BR /&gt;&amp;nbsp; proc report data=group_prov1 nowd style={rules=none frame=void};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *by group_id;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where group_id=&amp;amp;&amp;amp;grpid&amp;amp;i.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; column&amp;nbsp;&amp;nbsp; group_id dummy;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; define group_id / group "group" ;&lt;BR /&gt;&amp;nbsp; define dummy / order ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title j=c "sample" ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; footnote j=r "Page ~{thispage} of ~{lastpage}";&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp; title;&lt;BR /&gt;&amp;nbsp; footnote;&lt;BR /&gt;%end;&lt;BR /&gt;ods pdf close;&lt;BR /&gt;%mend;&lt;BR /&gt;%pdfrep;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 21:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-last-page-number-by-group-variable/m-p/96935#M9546</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-01T21:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: ODS PDF - last page number by group variable</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-last-page-number-by-group-variable/m-p/96936#M9547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are many pagexofy macros floating around since before ODS. But you might want to open a track with Tech Support. The cleanest option is to make a separate PDF for every BY group and use the SAS system option to start at 1 with the page numbers. Then use some PDF "combiner" software to manually combine the separate group files into 1 big file or multiple files. The dummy page break variable is also a tried and true method, but you may not be able to make the page numbering cooperate the way you want with that approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 22:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-last-page-number-by-group-variable/m-p/96936#M9547</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-08-01T22:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: ODS PDF - last page number by group variable</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-last-page-number-by-group-variable/m-p/96937#M9548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fugue and Cynthia.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I also tried Chang C. Chung's paper on page X of Y, but it doesn't work properly in this case. I have actually tried all the possible macros and all of them do work fine when there is a single PDF for each by group, but not with the multiple groups into single PDF. However, I right now am creating separate PDF file for each group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dharmendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2013 01:31:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-last-page-number-by-group-variable/m-p/96937#M9548</guid>
      <dc:creator>dtirumalasetti</dc:creator>
      <dc:date>2013-08-02T01:31:08Z</dc:date>
    </item>
  </channel>
</rss>

