<?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: Variables in a Spanning Header in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Variables-in-a-Spanning-Header/m-p/6573#M2567</link>
    <description>Hi:&lt;BR /&gt;
  This is not directly possible unless you use a SAS Macro Program. Your other alternative is to use BY group processing in PROC REPORT and then to use #BYVAR/#BYVAL in the Title statement for Proc Report -- I know this isn't in the spanning header -- but it may be close to what you want. There's an example of a small SAS macro program with variable information in the spanning header program below. The PROC REPORT isn't very complicated...but it does show overridding the value of a header. You could make the macro logic as complicated as it needed to be.&lt;BR /&gt;
  &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
  &lt;BR /&gt;
%macro myhdr(reg=, prod=, hdtxt= );&lt;BR /&gt;
  %if ® = Asia %then %let hdtxt = Something Else;&lt;BR /&gt;
   &lt;BR /&gt;
  proc report data=sashelp.shoes(obs=20) nowd;&lt;BR /&gt;
     where Region = "®" and product = "∏";&lt;BR /&gt;
     column region ("&amp;amp;hdtxt" region product sales );&lt;BR /&gt;
  run;&lt;BR /&gt;
%mend myhdr;&lt;BR /&gt;
     &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\myhdr.html' style=sasweb;&lt;BR /&gt;
  %myhdr(reg=Africa, prod=Sandal, hdtxt=African Sandals);&lt;BR /&gt;
  %myhdr(reg=Asia, prod=Boot, hdtxt=Asian Boots);&lt;BR /&gt;
  %myhdr(reg=Canada, prod=Slipper, hdtxt=Canadian Slippers);&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Mon, 28 Jan 2008 16:33:10 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2008-01-28T16:33:10Z</dc:date>
    <item>
      <title>Variables in a Spanning Header</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Variables-in-a-Spanning-Header/m-p/6572#M2566</link>
      <description>I have a proc report that uses a spanning header over multiple columns.  I need to vary the contents of the spanning header based on a variable.  is this possible?&lt;BR /&gt;
&lt;BR /&gt;
JK</description>
      <pubDate>Mon, 28 Jan 2008 12:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Variables-in-a-Spanning-Header/m-p/6572#M2566</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-28T12:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in a Spanning Header</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Variables-in-a-Spanning-Header/m-p/6573#M2567</link>
      <description>Hi:&lt;BR /&gt;
  This is not directly possible unless you use a SAS Macro Program. Your other alternative is to use BY group processing in PROC REPORT and then to use #BYVAR/#BYVAL in the Title statement for Proc Report -- I know this isn't in the spanning header -- but it may be close to what you want. There's an example of a small SAS macro program with variable information in the spanning header program below. The PROC REPORT isn't very complicated...but it does show overridding the value of a header. You could make the macro logic as complicated as it needed to be.&lt;BR /&gt;
  &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
  &lt;BR /&gt;
%macro myhdr(reg=, prod=, hdtxt= );&lt;BR /&gt;
  %if ® = Asia %then %let hdtxt = Something Else;&lt;BR /&gt;
   &lt;BR /&gt;
  proc report data=sashelp.shoes(obs=20) nowd;&lt;BR /&gt;
     where Region = "®" and product = "∏";&lt;BR /&gt;
     column region ("&amp;amp;hdtxt" region product sales );&lt;BR /&gt;
  run;&lt;BR /&gt;
%mend myhdr;&lt;BR /&gt;
     &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\myhdr.html' style=sasweb;&lt;BR /&gt;
  %myhdr(reg=Africa, prod=Sandal, hdtxt=African Sandals);&lt;BR /&gt;
  %myhdr(reg=Asia, prod=Boot, hdtxt=Asian Boots);&lt;BR /&gt;
  %myhdr(reg=Canada, prod=Slipper, hdtxt=Canadian Slippers);&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 28 Jan 2008 16:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Variables-in-a-Spanning-Header/m-p/6573#M2567</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-01-28T16:33:10Z</dc:date>
    </item>
  </channel>
</rss>

