<?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 Combining Headers in Proc Print in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Combining-Headers-in-Proc-Print/m-p/869132#M343323</link>
    <description>&lt;P&gt;Is there a way to combine headers with the same label within the proc print function?&amp;nbsp; For Instance, if I labeled gave both the firstname and lastname fields the same label as "name", could I run some variation&amp;nbsp;such as:&lt;/P&gt;
&lt;P&gt;proc print data=mydata label;&lt;/P&gt;
&lt;P&gt;var firstname lastname /style(header)=[background =lightblue ];&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and get an output of:&lt;/P&gt;
&lt;TABLE width="128"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="2" width="127.333px" class="lia-align-center"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="52.2292px"&gt;Bob&lt;/TD&gt;
&lt;TD width="75.1042px"&gt;Jones&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="52.2292px"&gt;Daffy&amp;nbsp;&lt;/TD&gt;
&lt;TD width="75.1042px"&gt;Duck&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2023 15:23:02 GMT</pubDate>
    <dc:creator>Lost_Gary</dc:creator>
    <dc:date>2023-04-11T15:23:02Z</dc:date>
    <item>
      <title>Combining Headers in Proc Print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-Headers-in-Proc-Print/m-p/869132#M343323</link>
      <description>&lt;P&gt;Is there a way to combine headers with the same label within the proc print function?&amp;nbsp; For Instance, if I labeled gave both the firstname and lastname fields the same label as "name", could I run some variation&amp;nbsp;such as:&lt;/P&gt;
&lt;P&gt;proc print data=mydata label;&lt;/P&gt;
&lt;P&gt;var firstname lastname /style(header)=[background =lightblue ];&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and get an output of:&lt;/P&gt;
&lt;TABLE width="128"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="2" width="127.333px" class="lia-align-center"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="52.2292px"&gt;Bob&lt;/TD&gt;
&lt;TD width="75.1042px"&gt;Jones&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="52.2292px"&gt;Daffy&amp;nbsp;&lt;/TD&gt;
&lt;TD width="75.1042px"&gt;Duck&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 15:23:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-Headers-in-Proc-Print/m-p/869132#M343323</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2023-04-11T15:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Headers in Proc Print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-Headers-in-Proc-Print/m-p/869138#M343325</link>
      <description>&lt;P&gt;Not in proc Print.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do this with Proc Report:&lt;/P&gt;
&lt;PRE&gt;data have;
   input name1 $ name2 $;
datalines;
Bob Jim
Fred Barney
;

proc report data=have;
   column ("Name label"  name1 name2);
   define name1 /"" ;
   define name2 /"";
run;&lt;/PRE&gt;
&lt;P&gt;The ("Name label" name1 name2) sets a spanning header over the columns Name 1 and Name2 as indicated by the ( ) around the text.&lt;/P&gt;
&lt;P&gt;The Define statements with the /"" suppress the default variable label that the individual variables would otherwise contribute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 15:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-Headers-in-Proc-Print/m-p/869138#M343325</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-11T15:40:30Z</dc:date>
    </item>
  </channel>
</rss>

