<?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: proc sgplot in rtf file in many pages in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420164#M19991</link>
    <description>Hi, also, I am not sure why you are using a GOPTIONS statement with the ODS Graphics SGPLOT. GOPTIONS has no impact on SGPLOT, SGPANEL or SGSCATTER procedures.&lt;BR /&gt;&lt;BR /&gt; Also, it is not clear to me what type of page numbering you want or why you are not using the normal ESCAPECHAR page numbering controls.&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
    <pubDate>Mon, 11 Dec 2017 15:59:07 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2017-12-11T15:59:07Z</dc:date>
    <item>
      <title>proc sgplot in rtf file in many pages</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420103#M19983</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have this dataset;&lt;/P&gt;&lt;P&gt;id start_date&amp;nbsp; &amp;nbsp; aval1&amp;nbsp; &amp;nbsp; aval2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;grp&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&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;A&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&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;A&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&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;A&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;10&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;12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;12&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; 21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;14&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;11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;16&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;12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;11&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; 25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&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;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&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;A&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&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;A&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&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;A&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;23&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; 13&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&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;A&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;18&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;A&amp;nbsp;&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; 10&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;20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; 13&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;17&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each id, I want to get a figure in one rtf page (so 3 pages).For each page , I want to have as footnote 'page n of N'. n is the number of the id and N is the total number (which is 3).I've created macro variables and I tried to use the 'where' statement in proc sgplot but it doesn't work because the where statement was rejected. This is a part of my code:&lt;/P&gt;&lt;P&gt;%DO i=1 %to &amp;amp;TOTAL. ;&lt;BR /&gt;TITLE font="Courier New" justify=center h=1.8 j=l "&amp;amp;&amp;amp;sub&amp;amp;i";&lt;BR /&gt;footnote4 font="Courier New" h=1.8 j=l "Page &amp;amp;i of &amp;amp;total";&lt;BR /&gt;proc sgplot data=fin2;&lt;BR /&gt;where id=&amp;amp;i.;&lt;BR /&gt;by id;&lt;BR /&gt;step x=start_date y=aval1 / lineattrs=(color=grey pattern=solid thickness=1.4mm) ;&lt;BR /&gt;step x=start_date y=aval2 / y2axis lineattrs=(color=green pattern=solid thickness=1.4mm) ;&lt;BR /&gt;xaxis label='Study day' minor minorcount=4&amp;nbsp; type=linear ;&lt;BR /&gt;yaxis label='Inhaled treprostinil' minor minorcount=4 offsetmin=1 offsetmax=1 type=linear&amp;nbsp; ;&lt;BR /&gt;y2axis label='Selexipag' labelpos=center minor minorcount=4 offsetmin=0 offsetmax=0 type=linear ;&lt;BR /&gt;keylegend / across=1 down=2 noborder linelength=4mm ;&lt;BR /&gt;run;&lt;BR /&gt;ods rtf close;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;ods _all_ close;&lt;BR /&gt;options ls=120;&lt;BR /&gt;%mend print;&lt;BR /&gt;%print;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestion please ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 13:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420103#M19983</guid>
      <dc:creator>oussema</dc:creator>
      <dc:date>2017-12-11T13:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot in rtf file in many pages</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420109#M19984</link>
      <description>&lt;P&gt;Yes, look up by group processing.&amp;nbsp; It should be a fundamental in the learning material but seems to have been removed and replaced with do everything in macro instead.&lt;/P&gt;
&lt;PRE&gt;ods escapechar="^";

title "...";
footnote4 'Page ^{thispage} of ^{lastpage}';

ods rtf file="...";

proc sgplot...;
  by id;
  ...
run;

ods rtf close;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Dec 2017 13:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420109#M19984</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-11T13:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot in rtf file in many pages</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420131#M19985</link>
      <description>&lt;P&gt;I don't know why it doesn't work. In the output I get 'page of' and not 'page 1 of 1' (for instance).&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 15:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420131#M19985</guid>
      <dc:creator>oussema</dc:creator>
      <dc:date>2017-12-11T15:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot in rtf file in many pages</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420145#M19986</link>
      <description>&lt;P&gt;You will need to set the option to not have titles/footnotes embedded in the graph:&lt;/P&gt;
&lt;PRE&gt;ods rtf file="..." nogtitle nogfoot;&lt;/PRE&gt;
&lt;P&gt;Then the titles/footers should be in the header/footer section of the output file and be resolved correctly at render time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 15:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420145#M19986</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-11T15:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot in rtf file in many pages</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420152#M19987</link>
      <description>&lt;P&gt;This is a part of the code, the problem remains:&lt;/P&gt;&lt;P&gt;options orientation=portrait papersize='ISO A4' nodate noDate nonumber nobyline;&lt;BR /&gt;%let figtit0 =&amp;nbsp;XXX ;&lt;BR /&gt;%let figtit1 =&amp;nbsp;YYY ;&lt;BR /&gt;%LET gtxt = 'Courier New';&lt;BR /&gt;%LET gtxtL = 'Courier New';&lt;BR /&gt;goptions reset=all&lt;BR /&gt;device=png gunit=pct rotate=portrait&lt;BR /&gt;xmax=10 in ymax=12 in&lt;BR /&gt;xpixels=1400 ypixels=1800&lt;BR /&gt;hsize=20.5 cm vsize=13 cm&lt;BR /&gt;ftext= 'Arial' htitle=9.0 pt htext=9.0 pt cback=white gwait=2 ;&lt;BR /&gt;goption display noborder ;&lt;/P&gt;&lt;P&gt;options orientation=portrait papersize='ISO A4' nodate noDate nonumber nobyline&lt;BR /&gt;bottommargin= 2.4 cm topmargin= 2.2 cm&lt;BR /&gt;leftmargin= 2.4 cm rightmargin= 2.0 cm;&lt;BR /&gt;ods escapechar='^';&lt;BR /&gt;TITLE1 font="Courier New" h=1.8 j=l "&amp;amp;figtit0.";&lt;BR /&gt;TITLE2 font="Courier New" h=1.8 j=l "&amp;amp;figtit1.";&lt;BR /&gt;footnote1 font="Courier New" h=1.8 j=l "xx";&lt;BR /&gt;footnote2 font="Courier New" h=1.8 j=l "xyz";&lt;BR /&gt;footnote3 font="Courier New" h=1.8 j=l "FFFF";&lt;BR /&gt;footnote4 'Page ^{thispage} of ^{lastpage}';&lt;BR /&gt;ods rtf file ="aaa.rtf"&lt;BR /&gt;style =normal NOGTITLE nogfootnote bodytitle;&lt;BR /&gt;ods listing style=listing;&lt;BR /&gt;proc sgplot data=fin2;&lt;BR /&gt;by ID;&lt;BR /&gt;step x=START_DATE y=aval1 / lineattrs=(color=grey pattern=solid thickness=1.4mm) ;&lt;BR /&gt;step x=&lt;SPAN&gt;START_DATE&lt;/SPAN&gt; y=aval2 / y2axis lineattrs=(color=green pattern=solid thickness=1.4mm) ;&lt;BR /&gt;xaxis label='Study day' minor minorcount=4&amp;nbsp; type=linear ;&lt;BR /&gt;yaxis label='AAA' minor minorcount=4 offsetmin=1 offsetmax=1 type=linear values=(0 to 15 by 1) ;&lt;BR /&gt;y2axis label='BB' labelpos=center minor minorcount=4 offsetmin=0 offsetmax=0 type=linear values=(0 to 1600 by 200) ;&lt;BR /&gt;keylegend / across=1 down=2 noborder linelength=4mm ;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;BR /&gt;ods rtf close;&lt;BR /&gt;ods _all_ close;&lt;BR /&gt;options ls=120;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 15:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420152#M19987</guid>
      <dc:creator>oussema</dc:creator>
      <dc:date>2017-12-11T15:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot in rtf file in many pages</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420157#M19989</link>
      <description>&lt;P&gt;Use a code window to post code - its the {i} above post - as this preserves formatting.&lt;/P&gt;
&lt;P&gt;At a guess I would say update this line to this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ods rtf file="aaa.rtf"&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;style=normal nogtitle nogfoot;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And remove the ods listing:&lt;BR /&gt;&lt;SPAN&gt;ods listing style=listing;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact, ods _all_ close;&amp;nbsp; before any programming is good as you aren't using listing output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, I can't test this.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 15:42:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420157#M19989</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-11T15:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot in rtf file in many pages</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420164#M19991</link>
      <description>Hi, also, I am not sure why you are using a GOPTIONS statement with the ODS Graphics SGPLOT. GOPTIONS has no impact on SGPLOT, SGPANEL or SGSCATTER procedures.&lt;BR /&gt;&lt;BR /&gt; Also, it is not clear to me what type of page numbering you want or why you are not using the normal ESCAPECHAR page numbering controls.&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Mon, 11 Dec 2017 15:59:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420164#M19991</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-12-11T15:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot in rtf file in many pages</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420261#M20000</link>
      <description>&lt;P&gt;Hello Cynthia,&lt;/P&gt;&lt;P&gt;I tried with escapechar but I don't know why it doesn't work (see the discussion above).&lt;/P&gt;&lt;P&gt;What I want to get is a graphic for each patient in an RTF file (every page contains one figure and a footnote 'page x of y' and a title which contain the id number). I couldn't combine the by group statement and a loop statement to get the required result.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 20:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420261#M20000</guid>
      <dc:creator>oussema</dc:creator>
      <dc:date>2017-12-11T20:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot in rtf file in many pages</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420312#M20001</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I created an example that uses SASHELP.CLASS and does what I think you want:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="get_page_numbers.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17153i1802A903D8961948/image-size/large?v=v2&amp;amp;px=999" role="button" title="get_page_numbers.png" alt="get_page_numbers.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I am sorry it is so small, but I have highlighted in yellow the Page X of Y page numbers in each footnote (showing 3 pages) and in the TITLE, I show the name (where you would show ID). You should be able to run this code. As you can see, I did not try to "overcontrol" things by doing my own page numbering or using a %DO loop. Since you did not show all of your macro code and since I find it best to have a working "proof of concept" before macroizing anything, I simplified the program and "hardcoded" the invocation of the macro program for each student inside my ODS RTF "sandwich".&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;** put the proc report and graph code in a macro program;
%macro makertf(wname=,xx=,xyz=,ffff=);
ods escapechar='^';
proc report data=sashelp.class;
  title j=c "ID/Name is for &amp;amp;wname";
  footnote1 j=l "&amp;amp;xx";
  footnote2 j=l "&amp;amp;xyz";
  footnote3 j=l "&amp;amp;FFFF";
  footnote4 'Page ^{thispage} of ^{lastpage}';  
  where name = "&amp;amp;wname";
  column name sex age height weight;
run;

** make a data label variable for the name of interest;
data graf_class;
  set sashelp.class;
  if name in ("&amp;amp;wname") then dl=Name;
  else dl = ' ';
run;

** if you are using RTF do NOT need to have ODS LISTING statement;
** before PROC SGPLOT;
proc sgplot data=graf_class;
  scatter x=height y=weight / datalabel=dl;
run;
%mend makertf;


** now invoke the macro program 1 time for each student;
options nodate nonumber orientation=portrait;
  
ods rtf file='c:\temp\test_pg_no.rtf' startpage=no nogtitle nogfootnote;
%makertf(wname=Alice, xx=AA1, xyz=AA12, FFFF=AAA123)

ods rtf startpage=now;

%makertf(wname=Alfred, xx=ABC1, xyz=ABC12, FFFF=ABC123)

ods rtf startpage=now;

%makertf(wname=Robert, xx=ABB1, xyz=ABB12, FFFF=AB123)
ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And while you could certainly "macroize" the whole program and the invocation for every student/patient/ID, I'd recommend getting it working like this and then inserting more macro logic of %DO loops. And you have to think about where you would want the %DO loops to be - or whether 1 macro would do the job or whether you'd need more than one macro program to get things done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; At any rate, I do find that ESCAPECHAR and the regular page x of y page numbering work for me in ODS RTF. Hope this points you in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 23:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-sgplot-in-rtf-file-in-many-pages/m-p/420312#M20001</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-12-11T23:26:21Z</dc:date>
    </item>
  </channel>
</rss>

