<?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 - how to page break by groups in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/789606#M252689</link>
    <description>&lt;P&gt;First thing, your shown code should throw an error because the parameter defined in the macro is TRTGRP= but us calls with TRT=.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try: BY Param Trtgrp;&amp;nbsp; ? If the data isn't sorted to use that add the NOTSORTED to the by statement if your data is grouped in the data set as wanted. If not sort/group it before proc report.&lt;/P&gt;
&lt;P&gt;You&amp;nbsp; could use the #BYvar and #ByVal approach in title statements to get the sort of heading you show.&lt;/P&gt;
&lt;P&gt;Param would be #Byvar1 with #Byval1 and Trtgrp would be #byvar2 and #byval2 in the order I show.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Likely you wouldn't want those variables in the Columns but I may be wrong.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jan 2022 22:33:21 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-01-11T22:33:21Z</dc:date>
    <item>
      <title>proc report - how to page break by groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/789599#M252685</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a proc report that page break by treatment group (variable trtgrp) and laboratory parameter (variable param).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HitmonTran_0-1641937936808.png" style="width: 680px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67332i8AF131C2E098BDA8/image-dimensions/680x300?v=v2" width="680" height="300" role="button" title="HitmonTran_0-1641937936808.png" alt="HitmonTran_0-1641937936808.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below is my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro dorpt (trtgrp=);&lt;BR /&gt;proc report data=final nowindows spacing=1 headskip headline split='|' spanrows;
      where trtgrp = "&amp;amp;trt" ;
	  by param;

      column trtgrp param avisitn avisit atoxgrn lbtox (/*"^S={borderbottomcolor=black borderbottomwidth=1} Baseline Result"*/'Baseline Result' col1-col5);

	  define trtgrp     / order noprint;
	  define param     / order noprint;
	  define avisitn   / order noprint;
	  define avisit    / group " " style(column)={asis=on width=2.8in just=left} style(header)={just=center};
	  define atoxgrn   / order noprint;
	  define lbtox     / order " " style(column)={width=1.4in just=left} style(header)={just=left};
	  define col1      / display "Normal" style(column)={width=.9in just=center} style(header)={just=center};
	  define col2      / display "Grade 1" style(column)={width=1.2in just=center} style(header)={just=center};
	  define col3      / display "Grade 2" style(column)={width=1.2in just=center} style(header)={just=center};
	  define col4      / display "Grade 3" style(column)={width=1.2in just=center} style(header)={just=center};
	  define col5      / display "Grade 4" style(column)={width=1.2in just=center} style(header)={just=center};

	* break after param /  page;

	 compute after avisitn;
	     line @1 " ";
	  endcomp; 

	/*  compute before param;
	   line @1 " ";
	   line @2 param $200.;
	  endcomp;*/


  run;&lt;BR /&gt;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%dorpt(trt=%str(1.0 mg/Placebo));&lt;BR /&gt;%dorpt(trt=%str(2.0 mg/Placebo));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jan 2022 21:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/789599#M252685</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2022-01-11T21:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: proc report - how to page break by groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/789606#M252689</link>
      <description>&lt;P&gt;First thing, your shown code should throw an error because the parameter defined in the macro is TRTGRP= but us calls with TRT=.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try: BY Param Trtgrp;&amp;nbsp; ? If the data isn't sorted to use that add the NOTSORTED to the by statement if your data is grouped in the data set as wanted. If not sort/group it before proc report.&lt;/P&gt;
&lt;P&gt;You&amp;nbsp; could use the #BYvar and #ByVal approach in title statements to get the sort of heading you show.&lt;/P&gt;
&lt;P&gt;Param would be #Byvar1 with #Byval1 and Trtgrp would be #byvar2 and #byval2 in the order I show.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Likely you wouldn't want those variables in the Columns but I may be wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 22:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/789606#M252689</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-11T22:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc report - how to page break by groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/789693#M252747</link>
      <description>&lt;P&gt;I think you can code like this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro dorpt (trtgrp= , param= );
title "XXXXXX  &amp;amp;trtgrp ";
title2 "YYYYYYYY &amp;amp;param ";
proc report data=final nowindows spacing=1 headskip headline split='|' spanrows;
      where trtgrp = "&amp;amp;trtgrp"  and param= "&amp;amp;param" ;
 column ...........&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jan 2022 12:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/789693#M252747</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-01-12T12:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc report - how to page break by groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/789807#M252780</link>
      <description>&lt;P&gt;thank you, the #BYVAR worked but now it's showing titles I don't need.&amp;nbsp; I tried using title10="&amp;nbsp; "; but it still shows.&amp;nbsp; How would I get rid of the red circle?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HitmonTran_0-1642018992587.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67359i503AA9DAD049A47B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HitmonTran_0-1642018992587.png" alt="HitmonTran_0-1642018992587.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;  title8 j=l "Laboratory Parameter: #byval2";
  title9 height=9pt j=l "Treatment Group: &amp;amp;trt";

    proc report data=final nowindows spacing=1 headskip headline split='|' spanrows;
      by trtgrp param;&lt;BR /&gt;
      column  avisitn avisit atoxgrn lbtox (/*"^S={borderbottomcolor=black borderbottomwidth=1} Baseline Result"*/'Baseline Result' col1-col5);
 
	  define avisitn   / order noprint;
	  define avisit    / group " " style(column)={asis=on width=2.8in just=left} style(header)={just=center};
	  define atoxgrn   / order noprint;
	  define lbtox     / order " " style(column)={width=1.4in just=left} style(header)={just=left};
	  define col1      / display "Normal" style(column)={width=.9in just=center} style(header)={just=center};
	  define col2      / display "Grade 1" style(column)={width=1.2in just=center} style(header)={just=center};
	  define col3      / display "Grade 2" style(column)={width=1.2in just=center} style(header)={just=center};
	  define col4      / display "Grade 3" style(column)={width=1.2in just=center} style(header)={just=center};
	  define col5      / display "Grade 4" style(column)={width=1.2in just=center} style(header)={just=center};
 

	 compute after avisitn;
	     line @1 " ";
	  endcomp; 
 
  run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jan 2022 20:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/789807#M252780</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2022-01-12T20:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: proc report - how to page break by groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/916163#M360914</link>
      <description>&lt;P&gt;Just use options nobyline;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 20:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-how-to-page-break-by-groups/m-p/916163#M360914</guid>
      <dc:creator>AD16</dc:creator>
      <dc:date>2024-02-14T20:14:48Z</dc:date>
    </item>
  </channel>
</rss>

