<?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: Pagenumber assign into macrovariable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Pagenumber-assign-into-macrovariable/m-p/933432#M367110</link>
    <description>&lt;P&gt;Thanks so much , it's worked&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 22 Jun 2024 23:29:33 GMT</pubDate>
    <dc:creator>mmkr</dc:creator>
    <dc:date>2024-06-22T23:29:33Z</dc:date>
    <item>
      <title>Pagenumber assign into macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pagenumber-assign-into-macrovariable/m-p/933427#M367104</link>
      <description>&lt;P&gt;How do i assign page number in to macro varibale ?&lt;/P&gt;
&lt;P&gt;proc sort data=sashelp.class out=class;&lt;BR /&gt;by age;&lt;BR /&gt;where age in (12,13,14);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;ods proclabel 'Report';&lt;BR /&gt;ods pdf startpage=yes;&lt;/P&gt;
&lt;P&gt;/*I want to add page number variable into macro variable */&lt;BR /&gt;/*I want to reset pagenumber when ever new age starts in new page */&lt;BR /&gt;/*Basically I need two pagenumbers &lt;BR /&gt;one is full in order, other one is by age */&lt;/P&gt;
&lt;P&gt;proc report data=class contents='' headline nowindows;by age;&lt;BR /&gt;columns name sex age height weight;&lt;/P&gt;
&lt;P&gt;define name / display "Name";&lt;BR /&gt;define sex / display "Sex";&lt;BR /&gt;define age / group display "Age" ;&lt;BR /&gt;define height / display "Height";&lt;BR /&gt;define weight / display "Weight";&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;BR /&gt;ods pdf close;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2024 16:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pagenumber-assign-into-macrovariable/m-p/933427#M367104</guid>
      <dc:creator>mmkr</dc:creator>
      <dc:date>2024-06-22T16:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pagenumber assign into macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pagenumber-assign-into-macrovariable/m-p/933428#M367105</link>
      <description>&lt;P&gt;&lt;SPAN&gt;/*I want to add page number variable into macro variable */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/*I want to reset pagenumber when ever new age starts in new page */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/*Basically I need two pagenumbers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;one is full in order, other one is by age */&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2024 16:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pagenumber-assign-into-macrovariable/m-p/933428#M367105</guid>
      <dc:creator>mmkr</dc:creator>
      <dc:date>2024-06-22T16:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Pagenumber assign into macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pagenumber-assign-into-macrovariable/m-p/933431#M367106</link>
      <description>&lt;P&gt;How would putting a page number into a macro variable help you?&amp;nbsp; What SAS code would use the macro variable to generate?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general if you want to number the pages then you will need to know where the pages start in advance.&amp;nbsp; Which might be difficlut for a complicated report.&amp;nbsp; But if you are willing to risk a little more white space and really needed then just divide the data into pages and then use #BYVAL() to print the page number on the page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
  by sex name;
run;
data class;
  set class;
  by sex;
  if first.sex then row=1;
  else row+1;
  page=ceil(row/5);
run;
ods pdf file="c:\downloads\pageby.pdf";
options nobyline;
title1 "Sex=#byval(sex) Page=#byval(page)";
proc print data=class;
  by sex page;
  pageby page;
run;
ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1719086800414.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/97796i4B34F69CE2A03E1E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1719086800414.png" alt="Tom_0-1719086800414.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2024 20:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pagenumber-assign-into-macrovariable/m-p/933431#M367106</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-22T20:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Pagenumber assign into macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pagenumber-assign-into-macrovariable/m-p/933432#M367110</link>
      <description>&lt;P&gt;Thanks so much , it's worked&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2024 23:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pagenumber-assign-into-macrovariable/m-p/933432#M367110</guid>
      <dc:creator>mmkr</dc:creator>
      <dc:date>2024-06-22T23:29:33Z</dc:date>
    </item>
  </channel>
</rss>

