<?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 Print to Excel does not split labels in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Print-to-Excel-does-not-split-labels/m-p/44446#M5866</link>
    <description>I am not sure why your example does not work.  I used the following example with good results.&lt;BR /&gt;
&lt;BR /&gt;
  /*-- Create data --*/&lt;BR /&gt;
  /*-----------------*/&lt;BR /&gt;
data prdsale;&lt;BR /&gt;
  set sashelp.prdsale;&lt;BR /&gt;
  Difference = actual-predict;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=prdsale;&lt;BR /&gt;
  by country region division year;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  /*-- Create ExcelXP output using modified --*/&lt;BR /&gt;
  /*-- style.                               --*/&lt;BR /&gt;
  /*-- Using autofilter, frozen_headers,    --*/&lt;BR /&gt;
  /*-- frozen_rowheaders, auto_subtotals    --*/&lt;BR /&gt;
  /*------------------------------------------*/&lt;BR /&gt;
%filename (a, mexl18ab, xml);&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp file=a options(autofilter='1-3' frozen_headers='2'&lt;BR /&gt;
   frozen_rowheaders='4' auto_subtotals='yes');&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  /*-- Use Excel formulas to represent computed cells,  --*/&lt;BR /&gt;
  /*-- and use an Excel format to force Excel to show   --*/&lt;BR /&gt;
  /*-- negative currency values in red and with the     --*/&lt;BR /&gt;
  /*-- format ($nnn).  In the formula below, the RC     --*/&lt;BR /&gt;
  /*-- value corresponds to the cell relative to the    --*/&lt;BR /&gt;
  /*-- current cell.  For example, RC[-2] means "2      --*/&lt;BR /&gt;
  /*-- cells to the left of the current cell".  Any     --*/&lt;BR /&gt;
  /*-- valid Excel formula can be used, and the formula --*/&lt;BR /&gt;
  /*-- used here matches the computation performed      --*/&lt;BR /&gt;
  /*-- in the DATA step that created the column.        --*/&lt;BR /&gt;
  /*------------------------------------------------------*/&lt;BR /&gt;
&lt;BR /&gt;
title2 'Print of data using tagattr with formats';&lt;BR /&gt;
title3 'predict &amp;amp; actual - ';&lt;BR /&gt;
title4 'difference - ';&lt;BR /&gt;
title5 'Sums - ';&lt;BR /&gt;
  proc print data=prdsale noobs label;&lt;BR /&gt;
    id country region division;&lt;BR /&gt;
    var prodtype product quarter month year;&lt;BR /&gt;
    var predict actual / style={tagattr='format:$#,##0_);[Red]\($#,##0\)'};&lt;BR /&gt;
    var difference /&lt;BR /&gt;
style={tagattr='format:$#,##0_);[Red]\($#,##0\) formula:RC[-1]-RC[-2]'};&lt;BR /&gt;
    sum predict actual difference /&lt;BR /&gt;
style={tagattr='format:$#,##0_);[Red]\($#,##0\)'};;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
title6 'Adding labels to prodtype, predict and actual';&lt;BR /&gt;
  proc print data=prdsale noobs label split='*';&lt;BR /&gt;
    id country region division;&lt;BR /&gt;
    var prodtype product quarter month year;&lt;BR /&gt;
    var predict actual / style={tagattr='format:$#,##0_);[Red]\($#,##0\)'};&lt;BR /&gt;
    var difference /&lt;BR /&gt;
style={tagattr='format:$#,##0_);[Red]\($#,##0\) formula:RC[-1]-RC[-2]'};&lt;BR /&gt;
    sum predict actual difference /&lt;BR /&gt;
style={tagattr='format:$#,##0_);[Red]\($#,##0\)'};;&lt;BR /&gt;
    label prodtype = 'Product*Type'&lt;BR /&gt;
          predict  = 'Predicted*Sales*For Area'&lt;BR /&gt;
          actual   = 'Actual*Sales*Amount';&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp close;</description>
    <pubDate>Wed, 10 Sep 2008 20:03:41 GMT</pubDate>
    <dc:creator>Eric_SAS</dc:creator>
    <dc:date>2008-09-10T20:03:41Z</dc:date>
    <item>
      <title>Proc Print to Excel does not split labels</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Print-to-Excel-does-not-split-labels/m-p/44445#M5865</link>
      <description>Hi there,&lt;BR /&gt;
&lt;BR /&gt;
using following code I get no splitted labels in the headers of the excel-sheet:&lt;BR /&gt;
&lt;BR /&gt;
TITLE1 f=arial h=10pt j=l bold "some title";&lt;BR /&gt;
TITLE2 f=arial h=8pt j=l bold "some title" ;&lt;BR /&gt;
TITLE3 f=arial h=12pt j=l bold 'other subtitle' ;&lt;BR /&gt;
TITLE4 f=arial h=10pt j=l bold 'other subtitle' ;&lt;BR /&gt;
options ls=256; &lt;BR /&gt;
&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods tagsets.excelxp &lt;BR /&gt;
    file="C:\myfile.xls" &lt;BR /&gt;
    style=mystyle          /* contains font specs only */&lt;BR /&gt;
   options(	sheet_interval='bygroup'&lt;BR /&gt;
	sheet_label=' ' 		&lt;BR /&gt;
	autofilter='all'        &lt;BR /&gt;
	frozen_headers='7'  	&lt;BR /&gt;
	embedded_titles='yes'   &lt;BR /&gt;
	embedded_footnotes='yes'&lt;BR /&gt;
	autofit_height = 'yes');&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=work.test noobs label split='+' &lt;BR /&gt;
        style( header ) = {background=CX800000 foreground=CXFFFFFF} ;&lt;BR /&gt;
by bvar;&lt;BR /&gt;
sum v1 		/ style={tagattr='format:#,##0'};&lt;BR /&gt;
... more sum statements as above ...&lt;BR /&gt;
pageby bvar;&lt;BR /&gt;
var bvar / style={tagattr='format:@'};&lt;BR /&gt;
var v1   / style={tagattr='format:#,##0'};&lt;BR /&gt;
.... more vars as above ...&lt;BR /&gt;
label&lt;BR /&gt;
  v1='firstline+secondline'&lt;BR /&gt;
... more labels statements...&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I am using SAS 9.1.3 SP4 under WinXP SP2, using ExcelXP tagset v1.86, 04/15/08.&lt;BR /&gt;
Whatsoever I do, I don't get any split headers in the xcl-sheet, only the sign for the non-printable char. When I edit the cell, excel show the right formatting (two lines), which are applied when I leave the cell with &lt;CR&gt;, but that's no use in production...&lt;BR /&gt;
&lt;BR /&gt;
Any ideas?&lt;/CR&gt;</description>
      <pubDate>Tue, 09 Sep 2008 11:59:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Print-to-Excel-does-not-split-labels/m-p/44445#M5865</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-09T11:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print to Excel does not split labels</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Print-to-Excel-does-not-split-labels/m-p/44446#M5866</link>
      <description>I am not sure why your example does not work.  I used the following example with good results.&lt;BR /&gt;
&lt;BR /&gt;
  /*-- Create data --*/&lt;BR /&gt;
  /*-----------------*/&lt;BR /&gt;
data prdsale;&lt;BR /&gt;
  set sashelp.prdsale;&lt;BR /&gt;
  Difference = actual-predict;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=prdsale;&lt;BR /&gt;
  by country region division year;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  /*-- Create ExcelXP output using modified --*/&lt;BR /&gt;
  /*-- style.                               --*/&lt;BR /&gt;
  /*-- Using autofilter, frozen_headers,    --*/&lt;BR /&gt;
  /*-- frozen_rowheaders, auto_subtotals    --*/&lt;BR /&gt;
  /*------------------------------------------*/&lt;BR /&gt;
%filename (a, mexl18ab, xml);&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp file=a options(autofilter='1-3' frozen_headers='2'&lt;BR /&gt;
   frozen_rowheaders='4' auto_subtotals='yes');&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  /*-- Use Excel formulas to represent computed cells,  --*/&lt;BR /&gt;
  /*-- and use an Excel format to force Excel to show   --*/&lt;BR /&gt;
  /*-- negative currency values in red and with the     --*/&lt;BR /&gt;
  /*-- format ($nnn).  In the formula below, the RC     --*/&lt;BR /&gt;
  /*-- value corresponds to the cell relative to the    --*/&lt;BR /&gt;
  /*-- current cell.  For example, RC[-2] means "2      --*/&lt;BR /&gt;
  /*-- cells to the left of the current cell".  Any     --*/&lt;BR /&gt;
  /*-- valid Excel formula can be used, and the formula --*/&lt;BR /&gt;
  /*-- used here matches the computation performed      --*/&lt;BR /&gt;
  /*-- in the DATA step that created the column.        --*/&lt;BR /&gt;
  /*------------------------------------------------------*/&lt;BR /&gt;
&lt;BR /&gt;
title2 'Print of data using tagattr with formats';&lt;BR /&gt;
title3 'predict &amp;amp; actual - ';&lt;BR /&gt;
title4 'difference - ';&lt;BR /&gt;
title5 'Sums - ';&lt;BR /&gt;
  proc print data=prdsale noobs label;&lt;BR /&gt;
    id country region division;&lt;BR /&gt;
    var prodtype product quarter month year;&lt;BR /&gt;
    var predict actual / style={tagattr='format:$#,##0_);[Red]\($#,##0\)'};&lt;BR /&gt;
    var difference /&lt;BR /&gt;
style={tagattr='format:$#,##0_);[Red]\($#,##0\) formula:RC[-1]-RC[-2]'};&lt;BR /&gt;
    sum predict actual difference /&lt;BR /&gt;
style={tagattr='format:$#,##0_);[Red]\($#,##0\)'};;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
title6 'Adding labels to prodtype, predict and actual';&lt;BR /&gt;
  proc print data=prdsale noobs label split='*';&lt;BR /&gt;
    id country region division;&lt;BR /&gt;
    var prodtype product quarter month year;&lt;BR /&gt;
    var predict actual / style={tagattr='format:$#,##0_);[Red]\($#,##0\)'};&lt;BR /&gt;
    var difference /&lt;BR /&gt;
style={tagattr='format:$#,##0_);[Red]\($#,##0\) formula:RC[-1]-RC[-2]'};&lt;BR /&gt;
    sum predict actual difference /&lt;BR /&gt;
style={tagattr='format:$#,##0_);[Red]\($#,##0\)'};;&lt;BR /&gt;
    label prodtype = 'Product*Type'&lt;BR /&gt;
          predict  = 'Predicted*Sales*For Area'&lt;BR /&gt;
          actual   = 'Actual*Sales*Amount';&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp close;</description>
      <pubDate>Wed, 10 Sep 2008 20:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Print-to-Excel-does-not-split-labels/m-p/44446#M5866</guid>
      <dc:creator>Eric_SAS</dc:creator>
      <dc:date>2008-09-10T20:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print to Excel does not split labels</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Print-to-Excel-does-not-split-labels/m-p/44447#M5867</link>
      <description>Hello Eric,&lt;BR /&gt;
&lt;BR /&gt;
thank you for your instructive reply.&lt;BR /&gt;
&lt;BR /&gt;
Running your example I have found a possible reason for the non-split headers:&lt;BR /&gt;
&lt;BR /&gt;
When I add to the second PROC PRINT statement &lt;BR /&gt;
the option &lt;BR /&gt;
STYLE( HEADER ) = {BACKGROUND=CX800000 FOREGROUND=CXFFFFFF}  &lt;BR /&gt;
&lt;BR /&gt;
the split is no longer in effect when I open the result in excel.&lt;BR /&gt;
I have to remove the style option and figure out how to color my headers using the style={tagattr= statement on each var. &lt;BR /&gt;
Is this possible?</description>
      <pubDate>Thu, 11 Sep 2008 07:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Print-to-Excel-does-not-split-labels/m-p/44447#M5867</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-11T07:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Print to Excel does not split labels</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Print-to-Excel-does-not-split-labels/m-p/44448#M5868</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have removed the STYLE(HEADER)= statement fomr the invocation of proc print and added to the SUM and VAR statements the STYLE(HEADER)={...} option individually, and voilá: it works.</description>
      <pubDate>Tue, 16 Sep 2008 10:51:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Print-to-Excel-does-not-split-labels/m-p/44448#M5868</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-16T10:51:35Z</dc:date>
    </item>
  </channel>
</rss>

