<?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 Customised Group Headers in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customised-Group-Headers/m-p/4535#M1840</link>
    <description>proc report data=sashelp.shoes nowd;&lt;BR /&gt;
title 'At Top of Page ~{thispage} of ~{lastpage}';&lt;BR /&gt;
footnote 'At Bottom of Page';&lt;BR /&gt;
  where region in ('Asia', 'Canada', 'Pacific', 'Western Europe');&lt;BR /&gt;
  column region product sales inventory;&lt;BR /&gt;
  define region / group;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales/ noprint;&lt;BR /&gt;
  define inventory/ 'Inventory';&lt;BR /&gt;
  break after region /summarize skip;&lt;BR /&gt;
  rbreak after / summarize;&lt;BR /&gt;
  compute before _page_;&lt;BR /&gt;
    line "Before Report Table";&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute before region;&lt;BR /&gt;
    line "Before Region";&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute after region;&lt;BR /&gt;
    if region = 'Central America/Caribbean' then region = 'Cent Amer/Carib';&lt;BR /&gt;
    region = trim(region)|| ' SubTotal';&lt;BR /&gt;
    line "After Region";&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute after;&lt;BR /&gt;
    region = 'Grand Total';&lt;BR /&gt;
    line "After Report Table";&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
In the code shown above how do i get the output shown below&lt;BR /&gt;
&lt;BR /&gt;
REGION = ASIA&lt;BR /&gt;
&lt;BR /&gt;
PRODUCT           SALES&lt;BR /&gt;
Boot                    $170,165&lt;BR /&gt;
Men's Casual       $2,176&lt;BR /&gt;
Men's Dress         $272,634&lt;BR /&gt;
Sandal                 $36,570&lt;BR /&gt;
Slipper                 $485,082&lt;BR /&gt;
Sport Shoe           $16,057&lt;BR /&gt;
                           ---------------&lt;BR /&gt;
Asia SubTotal       $1,176,139</description>
    <pubDate>Tue, 04 Sep 2007 20:47:21 GMT</pubDate>
    <dc:creator>SanjayM</dc:creator>
    <dc:date>2007-09-04T20:47:21Z</dc:date>
    <item>
      <title>Customised Group Headers</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customised-Group-Headers/m-p/4535#M1840</link>
      <description>proc report data=sashelp.shoes nowd;&lt;BR /&gt;
title 'At Top of Page ~{thispage} of ~{lastpage}';&lt;BR /&gt;
footnote 'At Bottom of Page';&lt;BR /&gt;
  where region in ('Asia', 'Canada', 'Pacific', 'Western Europe');&lt;BR /&gt;
  column region product sales inventory;&lt;BR /&gt;
  define region / group;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales/ noprint;&lt;BR /&gt;
  define inventory/ 'Inventory';&lt;BR /&gt;
  break after region /summarize skip;&lt;BR /&gt;
  rbreak after / summarize;&lt;BR /&gt;
  compute before _page_;&lt;BR /&gt;
    line "Before Report Table";&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute before region;&lt;BR /&gt;
    line "Before Region";&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute after region;&lt;BR /&gt;
    if region = 'Central America/Caribbean' then region = 'Cent Amer/Carib';&lt;BR /&gt;
    region = trim(region)|| ' SubTotal';&lt;BR /&gt;
    line "After Region";&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute after;&lt;BR /&gt;
    region = 'Grand Total';&lt;BR /&gt;
    line "After Report Table";&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
In the code shown above how do i get the output shown below&lt;BR /&gt;
&lt;BR /&gt;
REGION = ASIA&lt;BR /&gt;
&lt;BR /&gt;
PRODUCT           SALES&lt;BR /&gt;
Boot                    $170,165&lt;BR /&gt;
Men's Casual       $2,176&lt;BR /&gt;
Men's Dress         $272,634&lt;BR /&gt;
Sandal                 $36,570&lt;BR /&gt;
Slipper                 $485,082&lt;BR /&gt;
Sport Shoe           $16,057&lt;BR /&gt;
                           ---------------&lt;BR /&gt;
Asia SubTotal       $1,176,139</description>
      <pubDate>Tue, 04 Sep 2007 20:47:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customised-Group-Headers/m-p/4535#M1840</guid>
      <dc:creator>SanjayM</dc:creator>
      <dc:date>2007-09-04T20:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Customised Group Headers</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customised-Group-Headers/m-p/4536#M1841</link>
      <description>Hi:&lt;BR /&gt;
  -- 1a) You could either do it with BY group processing in PROC REPORT with the BY group info (REGION=ASIA) in a SAS title.&lt;BR /&gt;
&lt;BR /&gt;
  -- 1b) OR you could just use "regular" BY group processing with the BY information NOT in the title&lt;BR /&gt;
&lt;BR /&gt;
  -- 2) Or, you could use COMPUTE BEFORE _PAGE_  &lt;BR /&gt;
 &lt;BR /&gt;
 -- 3) Or you could use COMPUTE BEFORE [breakvar-name]&lt;BR /&gt;
&lt;BR /&gt;
Each technique has advantages and disadvantages and destinations where the technique will work better than other destinations.&lt;BR /&gt;
 &lt;BR /&gt;
Here is are code samples that shows each technique. For more help with PROC REPORT syntax, you should look at the PROC REPORT documentation, the papers listed at the end of this FAQ topic&lt;BR /&gt;
&lt;A href="http://support.sas.com/faq/030/FAQ03036.html" target="_blank"&gt;http://support.sas.com/faq/030/FAQ03036.html&lt;/A&gt;&lt;BR /&gt;
 or consider contacting Tech Support for more help.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
** 1a) by group and #byval;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
options nobyline nodate nonumber;&lt;BR /&gt;
ods html file='c:\temp\report1a.html' style=egdefault;&lt;BR /&gt;
proc report data=sashelp.shoes nowd&lt;BR /&gt;
     style(summary)=Header;&lt;BR /&gt;
  by region;&lt;BR /&gt;
  title '1a) Region = #byval(region)';&lt;BR /&gt;
  where region in ('Asia', 'Canada', 'Pacific', 'Western Europe');&lt;BR /&gt;
  column region product sales;&lt;BR /&gt;
  define region / group noprint;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales/ 'Sales';&lt;BR /&gt;
     &lt;BR /&gt;
  break after region /summarize skip ul ol;&lt;BR /&gt;
    &lt;BR /&gt;
  compute after region;&lt;BR /&gt;
    if region = 'Central America/Caribbean' then region = 'C Amer/Carib';&lt;BR /&gt;
    else if region = 'Western Europe' then region = 'W Eur';&lt;BR /&gt;
    else if region = 'Eastern Europe' then region = 'E Eur';&lt;BR /&gt;
    product = trim(region)|| ' SubTot';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
 &lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
options byline; &lt;BR /&gt;
title;&lt;BR /&gt;
 &lt;BR /&gt;
** 2a) Use regular BY line with BY group processing;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods html file='c:\temp\report1b.html' style=egdefault;&lt;BR /&gt;
proc report data=sashelp.shoes nowd&lt;BR /&gt;
     style(summary)=Header;&lt;BR /&gt;
  by region;&lt;BR /&gt;
  title 'The Report 1b';&lt;BR /&gt;
  where region in ('Asia', 'Canada', 'Pacific', 'Western Europe');&lt;BR /&gt;
  column region product sales;&lt;BR /&gt;
  define region / group noprint;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales/ 'Sales';&lt;BR /&gt;
     &lt;BR /&gt;
  break after region /summarize skip ul ol;&lt;BR /&gt;
    &lt;BR /&gt;
  compute after region;&lt;BR /&gt;
    if region = 'Central America/Caribbean' then region = 'C Amer/Carib';&lt;BR /&gt;
    else if region = 'Western Europe' then region = 'W Eur';&lt;BR /&gt;
    else if region = 'Eastern Europe' then region = 'E Eur';&lt;BR /&gt;
    product = trim(region)|| ' SubTot';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
   &lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
   &lt;BR /&gt;
** 3) compute before _page_ WITHOUT BY;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods html file='c:\temp\report2b.html' style=egdefault;&lt;BR /&gt;
proc report data=sashelp.shoes nowd&lt;BR /&gt;
     style(summary)=Header;&lt;BR /&gt;
  title 'The Report 3';&lt;BR /&gt;
  where region in ('Asia', 'Canada', 'Pacific', 'Western Europe');&lt;BR /&gt;
  column region product sales;&lt;BR /&gt;
  define region / group noprint;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales/ 'Sales';&lt;BR /&gt;
     &lt;BR /&gt;
  break before region / ;&lt;BR /&gt;
  break after region /summarize skip ul ol page;&lt;BR /&gt;
    &lt;BR /&gt;
  compute before _page_ / style={just=l};&lt;BR /&gt;
     line 'Region = ' Region $char25. ;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
    &lt;BR /&gt;
  compute after region;&lt;BR /&gt;
    if region = 'Central America/Caribbean' then region = 'C Amer/Carib';&lt;BR /&gt;
    else if region = 'Western Europe' then region = 'W Eur';&lt;BR /&gt;
    else if region = 'Eastern Europe' then region = 'E Eur';&lt;BR /&gt;
    product = trim(region)|| ' SubTot';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
 &lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
  &lt;BR /&gt;
** 3) compute before region;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods html file='c:\temp\report3.html' style=egdefault;&lt;BR /&gt;
proc report data=sashelp.shoes nowd&lt;BR /&gt;
     style(summary)=Header;&lt;BR /&gt;
  title 'The Report 3';&lt;BR /&gt;
  where region in ('Asia', 'Canada', 'Pacific', 'Western Europe');&lt;BR /&gt;
  column region product sales;&lt;BR /&gt;
  define region / group noprint;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales/ 'Sales';&lt;BR /&gt;
     &lt;BR /&gt;
  break before region / ;&lt;BR /&gt;
  break after region /summarize skip ul ol;&lt;BR /&gt;
    &lt;BR /&gt;
  compute before region / style={just=l};&lt;BR /&gt;
     line 'Region = ' Region $char25. ;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
    &lt;BR /&gt;
  compute after region;&lt;BR /&gt;
    if region = 'Central America/Caribbean' then region = 'C Amer/Carib';&lt;BR /&gt;
    else if region = 'Western Europe' then region = 'W Eur';&lt;BR /&gt;
    else if region = 'Eastern Europe' then region = 'E Eur';&lt;BR /&gt;
    product = trim(region)|| ' SubTot';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
 &lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 05 Sep 2007 04:24:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customised-Group-Headers/m-p/4536#M1841</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-09-05T04:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Customised Group Headers</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customised-Group-Headers/m-p/4537#M1842</link>
      <description>Brilliant, thanks a million</description>
      <pubDate>Wed, 05 Sep 2007 08:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customised-Group-Headers/m-p/4537#M1842</guid>
      <dc:creator>SanjayM</dc:creator>
      <dc:date>2007-09-05T08:04:22Z</dc:date>
    </item>
  </channel>
</rss>

