<?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 by variable override group label in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73927#M15933</link>
    <description>Thanks cynthia,&lt;BR /&gt;
&lt;BR /&gt;
But in my case the group headers printed as title  for each group (may be in same page depending up on the size of the group). If i use the method mentioned by you the group headers are printed inside the table and after each group. &lt;BR /&gt;
My condition is &lt;BR /&gt;
Group headers should be printed on top of each group not at the bottom and not inside the table.&lt;BR /&gt;
Is there any other way you suggest.&lt;BR /&gt;
Anand</description>
    <pubDate>Wed, 07 Apr 2010 20:43:04 GMT</pubDate>
    <dc:creator>anandbillava</dc:creator>
    <dc:date>2010-04-07T20:43:04Z</dc:date>
    <item>
      <title>Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73923#M15929</link>
      <description>When using proc report with by variable each group prints with label Group=. Is it possible to avoid this. I want to have just the variable value.</description>
      <pubDate>Tue, 06 Apr 2010 19:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73923#M15929</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-04-06T19:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73924#M15930</link>
      <description>Look at the title statement for the #BYVAR #BYVAL directives.&lt;BR /&gt;
&lt;BR /&gt;
Another alternative would be to include the variable in the COLUMN statement and print it with COMPUTE before _PAGE_.</description>
      <pubDate>Tue, 06 Apr 2010 20:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73924#M15930</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-04-06T20:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73925#M15931</link>
      <description>But i do not want each group to be printed in different page. I tihnk using byval. byvar and computer techniques will result in each group to be printed in different page</description>
      <pubDate>Tue, 06 Apr 2010 23:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73925#M15931</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-04-06T23:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73926#M15932</link>
      <description>Hi:&lt;BR /&gt;
  Using a BY statement will automatically cause PROC REPORT to start every BY group at the beginning of a new page. So if your BY group will all fit on one page, then if you have 3 by groups, you would have a 3 page report. BY group processing does not work any differently when you use #BYVAL/#BYVAR or not. You can see from the #1 report and #2 report below that each report contains 3 pages -- because of the BY statement. &lt;BR /&gt;
 &lt;BR /&gt;
  The difference is that if you compare report #3, without a BY statement, to the other 2 reports, this report has only 1 page (as compared to 3 pages). The BREAK statement still does a summary for each region, but since there is no BY statement, each region is on the same page. The empty line between regions comes from the LINE statement in the COMPUTE block for REGION.&lt;BR /&gt;
&lt;BR /&gt;
  The side effect of a BY statement is that you get every BY group on a separate page -- that's why the use of #BYVAL works in a TITLE -- because the BY information is available to be used.&lt;BR /&gt;
 &lt;BR /&gt;
  If you further look at the #4 report -- you will see how a COMPUTE BEFORE can be used to put a header above every REGION value.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
options nodate pageno=1;&lt;BR /&gt;
                      &lt;BR /&gt;
proc sort data=sashelp.shoes out=shoes;&lt;BR /&gt;
  by region product;&lt;BR /&gt;
run;&lt;BR /&gt;
                        &lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods pdf file='useby1.pdf';&lt;BR /&gt;
ods rtf file='useby1.rtf';&lt;BR /&gt;
ods html file='useby1.html' style=sasweb;&lt;BR /&gt;
                  &lt;BR /&gt;
proc report data=shoes nowd;&lt;BR /&gt;
  by region;&lt;BR /&gt;
  title '1) use by statement';&lt;BR /&gt;
  where region in ('Asia', 'Pacific', 'Canada');&lt;BR /&gt;
  column product sales inventory returns;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales / sum;&lt;BR /&gt;
  define inventory / sum;&lt;BR /&gt;
  define returns/ sum;&lt;BR /&gt;
  rbreak after / summarize;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
                 &lt;BR /&gt;
options nodate pageno=1 nobyline;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods pdf file='useby2.pdf';&lt;BR /&gt;
ods rtf file='useby2.rtf';&lt;BR /&gt;
ods html file='useby2.html' style=sasweb;&lt;BR /&gt;
               &lt;BR /&gt;
proc report data=shoes nowd;&lt;BR /&gt;
  by region;&lt;BR /&gt;
  title '2) use BYVAL statement for #byval1';&lt;BR /&gt;
  where region in ('Asia', 'Pacific', 'Canada');&lt;BR /&gt;
  column product sales inventory returns;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales / sum;&lt;BR /&gt;
  define inventory / sum;&lt;BR /&gt;
  define returns/ sum;&lt;BR /&gt;
  rbreak after / summarize;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
options byline;&lt;BR /&gt;
                         &lt;BR /&gt;
 &lt;BR /&gt;
options nodate pageno=1;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods pdf file='noby3.pdf';&lt;BR /&gt;
ods rtf file='noby3.rtf';&lt;BR /&gt;
ods html file='noby3.html' style=sasweb;&lt;BR /&gt;
                          &lt;BR /&gt;
proc report data=shoes nowd;&lt;BR /&gt;
  title '3) No BY statement in this proc report';&lt;BR /&gt;
  where region in ('Asia', 'Pacific', 'Canada');&lt;BR /&gt;
  column region product sales inventory returns;&lt;BR /&gt;
  define region / group;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales / sum;&lt;BR /&gt;
  define inventory / sum;&lt;BR /&gt;
  define returns/ sum;&lt;BR /&gt;
  break after region / summarize;&lt;BR /&gt;
  compute after region ;&lt;BR /&gt;
    line ' ';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
                       &lt;BR /&gt;
options nodate pageno=1;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods pdf file='noby4.pdf';&lt;BR /&gt;
ods rtf file='noby4.rtf';&lt;BR /&gt;
ods html file='noby4.html' style=sasweb;&lt;BR /&gt;
                                &lt;BR /&gt;
proc report data=shoes nowd;&lt;BR /&gt;
  title '4) No BY statement -- use COMPUTE BEFORE';&lt;BR /&gt;
  where region in ('Asia', 'Pacific', 'Canada');&lt;BR /&gt;
  column region product sales inventory returns;&lt;BR /&gt;
  define region / group noprint;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales / sum;&lt;BR /&gt;
  define inventory / sum;&lt;BR /&gt;
  define returns/ sum;&lt;BR /&gt;
  break after region / summarize;&lt;BR /&gt;
  compute after region ;&lt;BR /&gt;
    line ' ';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute before region /&lt;BR /&gt;
    style=Header{just=l font_weight=bold};&lt;BR /&gt;
    before_line = catx(' ','Region:',trim(region));&lt;BR /&gt;
	line before_line $100.;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
                 &lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 07 Apr 2010 06:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73926#M15932</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-04-07T06:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73927#M15933</link>
      <description>Thanks cynthia,&lt;BR /&gt;
&lt;BR /&gt;
But in my case the group headers printed as title  for each group (may be in same page depending up on the size of the group). If i use the method mentioned by you the group headers are printed inside the table and after each group. &lt;BR /&gt;
My condition is &lt;BR /&gt;
Group headers should be printed on top of each group not at the bottom and not inside the table.&lt;BR /&gt;
Is there any other way you suggest.&lt;BR /&gt;
Anand</description>
      <pubDate>Wed, 07 Apr 2010 20:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73927#M15933</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-04-07T20:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73928#M15934</link>
      <description>Hi:&lt;BR /&gt;
  The only 2 alternatives would be to &lt;BR /&gt;
--a) use BY group processing and use the #BYVAL in the title, as shown in report #2 above -- this had the effect of having the BY value in the TITLE (which would be outside the  table and in the title area) in this way, the #BYVAL in the title would be a "group header", but outside the table and at the "top" of each group &lt;BR /&gt;
or&lt;BR /&gt;
--b) use PROC REPORT and COMPUTE BEFORE _PAGE_-- but this would put the information for the GROUP inside the box of the table, which you said you didn't want.&lt;BR /&gt;
&lt;BR /&gt;
  I guess I do not understand what you mean by the "group headers are printed inside the table and &lt;B&gt;after&lt;/B&gt; each group". In my code examples, the "BREAK AFTER REGION is causing a summary line to be placed at the bottom of each group. But whether you look at report #2 or report #4, the name of the region is always placed -above- the report rows for the region.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 08 Apr 2010 05:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73928#M15934</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-04-08T05:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73929#M15935</link>
      <description>Thanks Cynthia... &lt;BR /&gt;
I got solution for many of my problems with your suggestion. I appreciate.&lt;BR /&gt;
Thanks once again.</description>
      <pubDate>Fri, 09 Apr 2010 16:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73929#M15935</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-04-09T16:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73930#M15936</link>
      <description>HI Cynthia,&lt;BR /&gt;
I am trying to add headers for each of the group, but at the same time when it encounters new page It should not print header twice. &lt;BR /&gt;
Please let me know if you have any idea.&lt;BR /&gt;
Anand</description>
      <pubDate>Thu, 22 Apr 2010 18:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73930#M15936</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-04-22T18:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73931#M15937</link>
      <description>Hi:&lt;BR /&gt;
  I am having a hard time envisioning what you mean by "add headers for each of the group" -- generally, when you use PROC REPORT, column headers -do- repeat at the top of every page in a paged destination, such as RTF or PDF. Can you post a sample program (using sashelp.shoes or sashelp.cars) that illustrates your issue. Please also describe your ODS destination of interest (RTF, PDF or HTML).&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 22 Apr 2010 18:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73931#M15937</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-04-22T18:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73932#M15938</link>
      <description>data shoes;&lt;BR /&gt;
	set sashelp.shoes;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
	ods pdf file='c:\1.pdf';&lt;BR /&gt;
			    proc report data=shoes split=' ' nocenter nowd style(REPORT)={cellspacing=0 cellpadding=2 background=white}&lt;BR /&gt;
			        style(HEADER)={foreground=black font_weight=bold font_size  = 1 just=center}&lt;BR /&gt;
			        style(COLUMN)={foreground=black font_size  = 1};&lt;BR /&gt;
					COLUMN  region product subsidiary stores sales; &lt;BR /&gt;
					define region / group noprint;&lt;BR /&gt;
				 	DEFINE edcC / DISPLAY 'EDC'  ;&lt;BR /&gt;
					DEFINE product / DISPLAY 'EDC'  ;&lt;BR /&gt;
					DEFINE subsidiary / DISPLAY 'EDC' ;&lt;BR /&gt;
					DEFINE stores / DISPLAY 'EDC'  ;&lt;BR /&gt;
					DEFINE sales / DISPLAY 'EDC'  ;&lt;BR /&gt;
&lt;BR /&gt;
					compute before region /    style=Header{just=l font_size  = 1 font_weight=bold background=wheat};&lt;BR /&gt;
					before_line = catx(' ',trim(region));&lt;BR /&gt;
					line before_line $300.;  &lt;BR /&gt;
					endcomp;&lt;BR /&gt;
				run;&lt;BR /&gt;
				 &lt;BR /&gt;
			ods pdf close ;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The above program writes output to a ODS destincation.&lt;BR /&gt;
You can see in the same page there are multiple groups printed. &lt;BR /&gt;
But the column headers are printed only once at the starting of the page and its not printed for each of the group if group starts in between pages.&lt;BR /&gt;
I dont wnat skip the pages when group does not have more observation to print in that page.&lt;BR /&gt;
Hopefuly this will help you in understanding.</description>
      <pubDate>Thu, 22 Apr 2010 19:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73932#M15938</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-04-22T19:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73933#M15939</link>
      <description>Hi:&lt;BR /&gt;
  To do what you want, you need to make separate tables for each group. This is going to require either a BREAK statement with the PAGE option (Approach 1) or using BY group processing (Approach 2). Luckily for you, ODS PDF has the STARTPAGE=NO option, which causes normal "page  break" behavior to be suppressed. So, where you would normally get a page break after or before each group with either of these techniques, the STARTPAGE=NO option will suppress the page break. Perhaps one of these 2 outputs is more what you wanted to get.&lt;BR /&gt;
&lt;BR /&gt;
  Please note that Approach 2 does require that the data is sorted for BY group processing and, if you want to suppress the normal BY line, you have to use the NOBYLINE option BEFORE your PROC REPORT step. Also note that with this approach, you may notice some difference in the overall table width because each group's table will be formatted separately (this means that the table for Africa may be a different width than the table for Asia, etc). If you want all the output tables to be the same width, then you would need to use the outputwidth= or width= option on your STYLE(REPORT) override:&lt;BR /&gt;
[pre]&lt;BR /&gt;
       style(REPORT)={cellspacing=0 cellpadding=2 background=white outputwidth=3in}&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                     &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
** Approach 1 -- use BREAK combined with STARTPAGE;&lt;BR /&gt;
ods pdf file='c:\temp\use_startpage.pdf' startpage=no;&lt;BR /&gt;
proc report data=sashelp.shoes split=' ' nocenter nowd &lt;BR /&gt;
     style(REPORT)={cellspacing=0 cellpadding=2 background=white}&lt;BR /&gt;
     style(HEADER)={foreground=black font_weight=bold font_size = 1 just=center}&lt;BR /&gt;
     style(COLUMN)={foreground=black font_size = 1};&lt;BR /&gt;
  title 'Approach 1';&lt;BR /&gt;
  COLUMN region product subsidiary stores sales; &lt;BR /&gt;
  define region / group noprint;&lt;BR /&gt;
  DEFINE product / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE subsidiary / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE stores / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE sales / DISPLAY 'EDC' ;&lt;BR /&gt;
  break after region / page;&lt;BR /&gt;
  compute before region / style=Header{just=l font_size = 1 font_weight=bold background=wheat};&lt;BR /&gt;
     before_line = catx(' ',trim(region));&lt;BR /&gt;
     line before_line $300.; &lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
                    &lt;BR /&gt;
ods pdf close ;&lt;BR /&gt;
                      &lt;BR /&gt;
                    &lt;BR /&gt;
** Approach 2 use BY group with STARTPAGE;&lt;BR /&gt;
proc sort data=sashelp.shoes out=shoes;&lt;BR /&gt;
  by region;&lt;BR /&gt;
run;&lt;BR /&gt;
     &lt;BR /&gt;
options nobyline;&lt;BR /&gt;
ods pdf file='c:\temp\use_startpage_bygroup.pdf' startpage=no uniform;&lt;BR /&gt;
proc report data=shoes split=' ' nocenter nowd &lt;BR /&gt;
     style(REPORT)={cellspacing=0 cellpadding=2 background=white}&lt;BR /&gt;
     style(HEADER)={foreground=black font_weight=bold font_size = 1 just=center}&lt;BR /&gt;
     style(COLUMN)={foreground=black font_size = 1};&lt;BR /&gt;
  title 'Approach 2';&lt;BR /&gt;
  by region;&lt;BR /&gt;
  COLUMN region product subsidiary stores sales; &lt;BR /&gt;
  define region / group noprint;&lt;BR /&gt;
  DEFINE product / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE subsidiary / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE stores / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE sales / DISPLAY 'EDC' ;&lt;BR /&gt;
  compute before region / style=Header{just=l font_size = 1 font_weight=bold background=wheat};&lt;BR /&gt;
     before_line = catx(' ',trim(region));&lt;BR /&gt;
     line before_line $300.; &lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
                  &lt;BR /&gt;
title;&lt;BR /&gt;
options byline;&lt;BR /&gt;
ods pdf close ;&lt;BR /&gt;
                              &lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 22 Apr 2010 20:20:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73933#M15939</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-04-22T20:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73934#M15940</link>
      <description>Thank you so much cynthia.&lt;BR /&gt;
But incase if I must add group header for the subsequent pages if one group spills to different pages.</description>
      <pubDate>Thu, 22 Apr 2010 20:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73934#M15940</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-04-22T20:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73935#M15941</link>
      <description>Hi:&lt;BR /&gt;
  In SAS 9.2, using COMPUTE BEFORE _PAGE_ instead of COMPUTE BEFORE REGION might give you the results you want. When I use the code below in SAS 9.2, the LINE statement output is written -above- the column headers even at the page break when using COMPUTE BEFORE _PAGE_. &lt;BR /&gt;
 &lt;BR /&gt;
  I no longer have SAS 9.1.3 to test with, so I'm not sure the same code will produce these same results in SAS 9.1.3. There used to be issues with COMPUTE BEFORE _PAGE_ in some ODS destinations in earlier versions of SAS.&lt;BR /&gt;
                &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
** Approach 1 -- use BREAK combined with STARTPAGE;&lt;BR /&gt;
ods pdf file='c:\temp\use_startpage_page.pdf' startpage=no;&lt;BR /&gt;
proc report data=sashelp.shoes split=' ' nocenter nowd&lt;BR /&gt;
     style(REPORT)={cellspacing=0 cellpadding=2 background=white outputwidth=3in}&lt;BR /&gt;
     style(HEADER)={foreground=black font_weight=bold font_size = 1 just=center}&lt;BR /&gt;
     style(COLUMN)={foreground=black font_size = 1};&lt;BR /&gt;
  title 'Approach 1';&lt;BR /&gt;
  COLUMN region product subsidiary stores sales; &lt;BR /&gt;
  define region / group noprint;&lt;BR /&gt;
  DEFINE product / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE subsidiary / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE stores / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE sales / DISPLAY 'EDC' ;&lt;BR /&gt;
  break after region / page;&lt;BR /&gt;
  compute before _page_ / style=Header{just=l font_size = 1 font_weight=bold background=wheat};&lt;BR /&gt;
     before_line = catx(' ',trim(region));&lt;BR /&gt;
     line before_line $300.; &lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
                              &lt;BR /&gt;
ods pdf close ;&lt;BR /&gt;
                                  &lt;BR /&gt;
                          &lt;BR /&gt;
** Approach 2 use BY group with STARTPAGE;&lt;BR /&gt;
proc sort data=sashelp.shoes out=shoes;&lt;BR /&gt;
  by region;&lt;BR /&gt;
run;&lt;BR /&gt;
           &lt;BR /&gt;
options nobyline;&lt;BR /&gt;
ods pdf file='c:\temp\use_startpage_bygroup_page.pdf' startpage=no;&lt;BR /&gt;
proc report data=shoes split=' ' nocenter nowd &lt;BR /&gt;
     style(REPORT)={cellspacing=0 cellpadding=2 background=white outputwidth=3in}&lt;BR /&gt;
     style(HEADER)={foreground=black font_weight=bold font_size = 1 just=center}&lt;BR /&gt;
     style(COLUMN)={foreground=black font_size = 1};&lt;BR /&gt;
  title 'Approach 2';&lt;BR /&gt;
  by region;&lt;BR /&gt;
  COLUMN region product subsidiary stores sales; &lt;BR /&gt;
  define region / group noprint;&lt;BR /&gt;
  DEFINE product / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE subsidiary / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE stores / DISPLAY 'EDC' ;&lt;BR /&gt;
  DEFINE sales / DISPLAY 'EDC' ;&lt;BR /&gt;
  compute before _page_ / style=Header{just=l font_size = 1 font_weight=bold background=wheat};&lt;BR /&gt;
     before_line = catx(' ',trim(region));&lt;BR /&gt;
     line before_line $300.; &lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
title;&lt;BR /&gt;
options byline;&lt;BR /&gt;
ods pdf close ;&lt;BR /&gt;
               &lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 23 Apr 2010 04:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73935#M15941</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-04-23T04:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73936#M15942</link>
      <description>Thanks cynthia.. that works</description>
      <pubDate>Tue, 27 Apr 2010 16:47:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73936#M15942</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-04-27T16:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73937#M15943</link>
      <description>hi,&lt;BR /&gt;
In The below statement what does $300 means.. Is there any maximum length for this. Because my group value breaks after some character.&lt;BR /&gt;
&lt;BR /&gt;
line before_line $300.;</description>
      <pubDate>Wed, 28 Apr 2010 20:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73937#M15943</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-04-28T20:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73938#M15944</link>
      <description>Hi:&lt;BR /&gt;
  That $300. is the FORMATTED length which should be used to write the variable BEFORE_LINE to the output file.&lt;BR /&gt;
 &lt;BR /&gt;
  The maximum length might conflict with LINESIZE if you were using the LISTING destination, however, since you are not using the LISTING destination, you can make that number bigger...or you can use the $VARYING. format in your COMPUTE block:&lt;BR /&gt;
[pre]&lt;BR /&gt;
   lg=length(before_line);&lt;BR /&gt;
   line before_line $varying. lg;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
The other issue you could be running into is the implied length for before_line -- which you could control with a LENGTH statement in your COMPUTE block.&lt;BR /&gt;
[pre]&lt;BR /&gt;
compute before _page_;&lt;BR /&gt;
  length before_line $500;&lt;BR /&gt;
  ...more code...&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                &lt;BR /&gt;
The LENGTH statement controls the internal storage size of the variable BEFORE_LINE, while the format size in the LINE statement controls the displayed size of the variable.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 28 Apr 2010 21:26:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73938#M15944</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-04-28T21:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73939#M15945</link>
      <description>Using startpage=no option in SAS 9.1.3 creates a weird problem when there is a single observation in a group and that starts in a new page. It does not prints the column headers rather it prints the group header twice. According to SAS tech support this issue is fixed in version 9.2</description>
      <pubDate>Mon, 03 May 2010 14:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73939#M15945</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-05-03T14:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73940#M15946</link>
      <description>Hello ,&lt;BR /&gt;
In this program I wanted to print different variable which is other than the group variable inside the compute before block.&lt;BR /&gt;
But its printing blank. But if I use the compute before varialbe then it prints without any problem. But printing different column or varirable inside the compute before using line is results in blank.&lt;BR /&gt;
&lt;BR /&gt;
Original,&lt;BR /&gt;
 compute before region /    style=Header{just=l font_weight=bold};    before_line = catx(' ','Region:',trim(region));	line before_line $100.;  endcomp;&lt;BR /&gt;
Instead of region I want to use some other variable like below..&lt;BR /&gt;
compute before region /    style=Header{just=l font_weight=bold};    before_line = catx(' ','Region:',trim(some_other_variable other than region));	line before_line $100.;  endcomp;&lt;BR /&gt;
&lt;BR /&gt;
Can somebody throw some light here ?&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: anandbillava

Message was edited by: anandbillava</description>
      <pubDate>Mon, 17 May 2010 20:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73940#M15946</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-05-17T20:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73941#M15947</link>
      <description>Hi:&lt;BR /&gt;
  &lt;BR /&gt;
PROC REPORT is not like a DATA step program. The variable you want to show or use in the COMPUTE before block may not be available to PROC REPORT. Remember that PROC REPORT has a couple of rules that control behavior:&lt;BR /&gt;
                &lt;BR /&gt;
1) Left to Right rule:  PROC REPORT builds each report row from left to right, as variables are listed on the COLUMN statement. So, for example, in the COLUMN statement below:&lt;BR /&gt;
  COLUMN REGION SUBSIDIARY PRODUCT SALES RETURNS;&lt;BR /&gt;
&lt;BR /&gt;
There is no visibility of SUBSIDIARY or PRODUCT inside the COMPUTE block for REGION. &lt;BR /&gt;
                        &lt;BR /&gt;
2) Every variable you use in a PROC REPORT step MUST be in the COLUMN statement or must be a temporary variable. So, for example, if you had this COLUMN statement:&lt;BR /&gt;
   COLUMN REGION PRODUCT SALES RETURNS;&lt;BR /&gt;
 &lt;BR /&gt;
Even if SUBSIDIARY was in the input dataset, if it is not even listed in the COLUMN statement, it will not be available to you for testing or using in a LINE statement.&lt;BR /&gt;
                       &lt;BR /&gt;
I do not know which of these situations you are encountering, but I suspect that one of these rules is what is causing the blanks to appear. Refer to this paper for some ideas of how to accomplish different break processing. &lt;BR /&gt;
 &lt;A href="http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf" target="_blank"&gt;http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf&lt;/A&gt;&lt;BR /&gt;
            &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 18 May 2010 05:02:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73941#M15947</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-05-18T05:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report by variable override group label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73942#M15948</link>
      <description>I will go through that. &lt;BR /&gt;
&lt;BR /&gt;
I have one more things in the above program can I print the group headers  which is printed inside the compute block also in starting of each page. Now this is not prinitng when group spills into new page. Group prints only once.&lt;BR /&gt;
&lt;BR /&gt;
I used by varialbe and other techniques but no luck yet. It prints group header when i use byval but it encounters different error. Accrodding to SAS this is a bug and its fixed in version 9.2. &lt;BR /&gt;
&lt;BR /&gt;
The bug is when there is only one observation for a group and if it had to start from a new page then groups are printed twice.</description>
      <pubDate>Tue, 18 May 2010 13:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-by-variable-override-group-label/m-p/73942#M15948</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-05-18T13:42:24Z</dc:date>
    </item>
  </channel>
</rss>

