<?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 report - name of group after page break in RTF in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472401#M21135</link>
    <description>&lt;P&gt;You need to provide examples of what you have, what you want, and explain between them, I cannot guess.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jun 2018 08:08:57 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-06-22T08:08:57Z</dc:date>
    <item>
      <title>Proc report - name of group after page break in RTF</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472387#M21132</link>
      <description>&lt;P&gt;Hi SAS experts,&lt;BR /&gt;&lt;BR /&gt;I wonder if there is a way how to insert row with group name after splitting group variable to two pages in RTF file.&lt;BR /&gt;&lt;BR /&gt;For example I have report such as:&lt;/P&gt;&lt;PRE&gt;&amp;lt;----- page 1 -----&amp;gt;
VAR1      | VAR2 | ...&lt;BR /&gt;Country   |      |
  UK      |      |  
  France  |      |
  Germany |      |

&amp;lt;----- page 2 -----&amp;gt;&lt;BR /&gt;VAR1      | VAR2 | ... &lt;BR /&gt; US       |      |&lt;BR /&gt; Russia   |      |&lt;/PRE&gt;&lt;P&gt;And I want the result to be like this:&lt;/P&gt;&lt;PRE&gt;&amp;lt;----- page 1 -----&amp;gt;
VAR1      | VAR2 | ...
Country   |      |
  UK      |      |  
  France  |      |
  Germany |      |

&amp;lt;----- page 2 -----&amp;gt;
VAR1      | VAR2 | ... 
Country (contd.)
 US       |      |
 Russia   |      |&lt;/PRE&gt;&lt;P&gt;Is there a way how I can check if the row is on new page so I can insert row with group name before it?&lt;BR /&gt;&lt;BR /&gt;Thank you for any advice&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 07:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472387#M21132</guid>
      <dc:creator>Matyas</dc:creator>
      <dc:date>2018-06-22T07:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report - name of group after page break in RTF</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472390#M21133</link>
      <description>&lt;P&gt;You would use a compute block, but you might need a flag in your data.&amp;nbsp; I.e.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;proc report ...;
  columns _all_;
  define pge / noprint;
  ...;

  break after pge / page;

  compute before page;
    length txt $20;
    if pge=1 then txt="Country";
    else txt="Country cont.";
    line txt;
  endcomp;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jun 2018 07:37:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472390#M21133</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-22T07:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report - name of group after page break in RTF</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472397#M21134</link>
      <description>&lt;P&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;I used that as example but the problem is more complicated. I have more than one group and I am seeking for general solution, that will input line on next page with the name of splitted group variable. Is that possible?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 08:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472397#M21134</guid>
      <dc:creator>Matyas</dc:creator>
      <dc:date>2018-06-22T08:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report - name of group after page break in RTF</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472401#M21135</link>
      <description>&lt;P&gt;You need to provide examples of what you have, what you want, and explain between them, I cannot guess.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 08:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472401#M21135</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-22T08:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report - name of group after page break in RTF</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472409#M21136</link>
      <description>&lt;P&gt;Yeah, sorry I was not accurate.&lt;BR /&gt;&lt;BR /&gt;What I have is this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="have.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21326i15E26BB7ADD980CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="have.JPG" alt="have.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I want is this:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="want.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21327i443CF617FD0D1536/image-size/medium?v=v2&amp;amp;px=400" role="button" title="want.JPG" alt="want.JPG" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;The code to produce output is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data in;
infile datalines delimiter=','; 
input region $ country $ status $ Total $ GroupA $ GroupB $ ord;
datalines;
Asia ,Taiwan ,Asia ,xx (xx%) ,xx (xx%) ,xx (xx%) ,1
Asia ,Taiwan ,Taiwan ,xx (xx%) ,xx (xx%) ,xx (xx%) ,1
Asia ,Taiwan ,town1 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,1
Asia ,Taiwan ,town2 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,1
Asia ,Taiwan ,town3 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,1
Asia ,Taiwan ,town4 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,1
Asia ,Taiwan ,town5 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,1
Asia ,Taiwan ,town6 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,1
Europe ,Belgium ,Europe ,xx (xx%) ,xx (xx%) ,xx (xx%) ,2
Europe ,Belgium ,Belgium ,xx (xx%) ,xx (xx%) ,xx (xx%) ,2
Europe ,Belgium ,town1 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,2
Europe ,Belgium ,town2 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,2
Europe ,Belgium ,town3 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,2
Europe ,Belgium ,town4 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,2
Europe ,Belgium ,town5 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,2
Europe ,Belgium ,town6 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,2
Europe ,France ,France ,xx (xx%) ,xx (xx%) ,xx (xx%) ,3
Europe ,France ,town1 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,3
Europe ,France ,town2 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,3
Europe ,France ,town3 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,3
Europe ,France ,town4 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,3
Europe ,Germany ,Germany ,xx (xx%) ,xx (xx%) ,xx (xx%) ,4
Europe ,Germany ,town1 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,4
Europe ,Germany ,town2 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,4
Europe ,Germany ,town3 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,4
Europe ,Germany ,town4 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,4
Europe ,Germany ,town5 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,4
Europe ,Germany ,town6 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,4
Europe ,Germany ,town7 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,4
Europe ,Germany ,town8 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,4
Europe ,Greece ,Greece ,xx (xx%) ,xx (xx%) ,xx (xx%) ,5
Europe ,Greece ,town1 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,5
Europe ,Greece ,town2 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,5
Europe ,Greece ,town3 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,5
Europe ,Greece ,town4 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,5
Europe ,Greece ,town5 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,5
Europe ,Greece ,town6 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,5
Europe ,Israel ,Israel ,xx (xx%) ,xx (xx%) ,xx (xx%) ,6
Europe ,Israel ,town1 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,6
Europe ,Israel ,town2 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,6
Europe ,Israel ,town3 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,6
Europe ,Israel ,town4 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,6
Europe ,Israel ,town5 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,6
Europe ,Israel ,town6 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,6
Europe ,Italy ,Italy ,xx (xx%) ,xx (xx%) ,xx (xx%) ,7
Europe ,Italy ,town1 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,7
Europe ,Italy ,town2 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,7
Europe ,Italy ,town3 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,7
Europe ,Italy ,town4 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,7
Europe ,Italy ,town5 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,7
Europe ,Italy ,town6 ,xx (xx%) ,xx (xx%) ,xx (xx%) ,7
;run;

OPTIONS ORIENTATION=landscape nodate nonumber nocenter papersize=A4 helpbrowser=sas;
ODS escapechar='#';
ODS RTF bodytitle nogtitle startpage=yes
file="C:\table.rtf";

ods listing close;
proc report data=in nowd split="~" out=pom;
	columns region country ord status Total GroupA GroupB;

	define region/noprint;
	define country/noprint;
	define ord/order noprint;

	define status/display style(column)=[indent=35 cellwidth=9.16cm] "Region -~  Country~    Site";
	define total/display style(column)=[indent=0 cellwidth=4.47cm] "Region";
	define GroupA/display style(column)=[indent=0 cellwidth=4.47cm] "GroupA";
	define GroupB/display style(column)=[indent=0 cellwidth=4.47cm] "GroupB";	

	/*indentation region - country - town*/
	compute status;
	 if status = region then do;
	  	 status = catx(" ", status, "-");
         call define(_col_, "style", "style=[indent=0]");
     end;
	 if status = country then do;
         call define(_col_, "style", "style=[indent=20]");
     end;
    endcomp;
	
    compute before ord;
		line ' ';
    endcomp;

run;
ods rtf close;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jun 2018 08:47:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472409#M21136</guid>
      <dc:creator>Matyas</dc:creator>
      <dc:date>2018-06-22T08:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report - name of group after page break in RTF</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472417#M21137</link>
      <description>&lt;P&gt;Yes, there is no automatic way of doing this simply.&amp;nbsp; You will need to format your data in a way that the data describes where the splits will be.&amp;nbsp; What I tend to do is to assign in a datastep each of the records I want to appear on one page.&amp;nbsp; Then I use that variable to break my report.&amp;nbsp; With this you could add in changes to the data to get the output you want.&amp;nbsp; So assume that 10 records max per page:&lt;/P&gt;
&lt;PRE&gt;data want;
  set in;
  retain pge 1;
  if mod(_n_,10)=0 then pge=pge+1;
run; &lt;/PRE&gt;
&lt;P&gt;You can then break on pge variable.&amp;nbsp; Now you need to alter the data after the page change, maybe something like:&lt;/P&gt;
&lt;PRE&gt;data want;
  set in;
  retain pge chg;&lt;BR /&gt;  if _n_=1 then pge=1;
  if mod(_n_,10)=0 then do;&lt;BR /&gt;    pge=pge+1;&lt;BR /&gt;    chg=1;&lt;BR /&gt;  end;&lt;BR /&gt;  if chg=1 and lag(region)=catx(" ",region,"(contd.)) then region=catx(" ",region,"(contd.)");&lt;BR /&gt;  else chg=0;
run; &lt;/PRE&gt;
&lt;P&gt;Not tested this, but what I am effectively trying to do is to change the data looks like:&lt;/P&gt;
&lt;P&gt;Germany&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pge=1&lt;/P&gt;
&lt;P&gt;Germany&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pge=1&lt;/P&gt;
&lt;P&gt;Germany (contd.) pge=2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this way you control when the page break happens and as the data looks like the output the group should automatically handle that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 09:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-name-of-group-after-page-break-in-RTF/m-p/472417#M21137</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-22T09:19:51Z</dc:date>
    </item>
  </channel>
</rss>

