<?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: How to save lastpage in a macro variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-lastpage-in-a-macro-variable/m-p/523473#M142218</link>
    <description>Hi:&lt;BR /&gt;  You must be creating either PDF or RTF output. You cannot save the ESCAPECHAR {lastpage} value in a macro variable, it is created dynamically based on the data that is being routed to either the PDF file or the RTF file.&lt;BR /&gt;&lt;BR /&gt;I have never seen a "not shown" blank page in ODS output. I have seen instances in both PDF and RTF, where an actual blank page is created, typically because the margins need to be adjusted.&lt;BR /&gt;&lt;BR /&gt;My suggestion is that you alter the papersize option and the margin options and the orientation in order to see whether you can get the correct value for ESCAPECHAR {lastpage} in your final output.&lt;BR /&gt;&lt;BR /&gt;If altering the margins don't work for you, then you might want to open a track with Tech Support. They can look at your actual data and ALL your code and try to replicate the issue. Then, they can help you with the solution.&lt;BR /&gt;Cynthia&lt;BR /&gt;</description>
    <pubDate>Tue, 25 Dec 2018 16:26:24 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2018-12-25T16:26:24Z</dc:date>
    <item>
      <title>How to save lastpage in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-lastpage-in-a-macro-variable/m-p/523463#M142210</link>
      <description>&lt;P&gt;Dear members,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am producing a report and I was asked to display&amp;nbsp; the page numbering in the footnote as 'Page X of&amp;nbsp; Y', I found a solution thanks to you in this forum but the Y (lastpage) was not correct as I have only 5 pages but it shows 6 pages. maybe because of a not shown blank page at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I was wondering if this&amp;nbsp;&lt;SPAN&gt;^{lastpage} can be saved in a macro variable?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2018 12:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-lastpage-in-a-macro-variable/m-p/523463#M142210</guid>
      <dc:creator>ellouho1</dc:creator>
      <dc:date>2018-12-25T12:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to save lastpage in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-lastpage-in-a-macro-variable/m-p/523473#M142218</link>
      <description>Hi:&lt;BR /&gt;  You must be creating either PDF or RTF output. You cannot save the ESCAPECHAR {lastpage} value in a macro variable, it is created dynamically based on the data that is being routed to either the PDF file or the RTF file.&lt;BR /&gt;&lt;BR /&gt;I have never seen a "not shown" blank page in ODS output. I have seen instances in both PDF and RTF, where an actual blank page is created, typically because the margins need to be adjusted.&lt;BR /&gt;&lt;BR /&gt;My suggestion is that you alter the papersize option and the margin options and the orientation in order to see whether you can get the correct value for ESCAPECHAR {lastpage} in your final output.&lt;BR /&gt;&lt;BR /&gt;If altering the margins don't work for you, then you might want to open a track with Tech Support. They can look at your actual data and ALL your code and try to replicate the issue. Then, they can help you with the solution.&lt;BR /&gt;Cynthia&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Dec 2018 16:26:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-lastpage-in-a-macro-variable/m-p/523473#M142218</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-12-25T16:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to save lastpage in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-lastpage-in-a-macro-variable/m-p/523678#M142296</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to change PAGESIZE,LINESIZE,MARGINS but no solution.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However, this issue comes only when I add the step to create 'Table of contents' by adding "contents=yes notoc_data" to the ODS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without those ODS options I get the real Last page number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 17:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-lastpage-in-a-macro-variable/m-p/523678#M142296</guid>
      <dc:creator>ellouho1</dc:creator>
      <dc:date>2018-12-27T17:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to save lastpage in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-lastpage-in-a-macro-variable/m-p/523698#M142304</link>
      <description>Hi:&lt;BR /&gt;  Does that mean that your page count is off by 1? My guess is that the table of contents page is getting counted by Word as a page. I don't know whether this is how Word is designed or not. This would be a question for Tech Support. They will need to look at your code to test.&lt;BR /&gt;Cynthia</description>
      <pubDate>Thu, 27 Dec 2018 19:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-lastpage-in-a-macro-variable/m-p/523698#M142304</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-12-27T19:40:12Z</dc:date>
    </item>
  </channel>
</rss>

