<?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: How do I use the ODS escapechar with the excelXP tagset? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18201#M3610</link>
    <description>using [pre]  proc print label split='*' ;[/pre]would allow you to define where a "hard return" should go into the column headers.&lt;BR /&gt;
&lt;BR /&gt;
Try that on a test basis.&lt;BR /&gt;
&lt;BR /&gt;
If you need the hard return in a data cell, you might be able to insert corresponding xml.&lt;BR /&gt;
&lt;BR /&gt;
I think the odsescapechar does not apply in tagsets.excelXP&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
    <pubDate>Fri, 16 May 2008 11:26:46 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-05-16T11:26:46Z</dc:date>
    <item>
      <title>How do I use the ODS escapechar with the excelXP tagset?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18200#M3609</link>
      <description>I would like to have a cell which contains a hard return.  However, when I specify a newline using the ODS escapechar it generates malformed XML.  For example:&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
x = 'aaa^nbbb';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
ods escapechar="^";&lt;BR /&gt;
ods tagsets.excelXP file="C:\temp\test.xls" style=styles.sasweb &lt;BR /&gt;
options (sheet_name= "test");&lt;BR /&gt;
&lt;BR /&gt;
proc print data=WORK.test noobs;&lt;BR /&gt;
var x;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
ods listing;&lt;BR /&gt;
&lt;BR /&gt;
Thank you.</description>
      <pubDate>Fri, 16 May 2008 01:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18200#M3609</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-16T01:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the ODS escapechar with the excelXP tagset?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18201#M3610</link>
      <description>using [pre]  proc print label split='*' ;[/pre]would allow you to define where a "hard return" should go into the column headers.&lt;BR /&gt;
&lt;BR /&gt;
Try that on a test basis.&lt;BR /&gt;
&lt;BR /&gt;
If you need the hard return in a data cell, you might be able to insert corresponding xml.&lt;BR /&gt;
&lt;BR /&gt;
I think the odsescapechar does not apply in tagsets.excelXP&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Fri, 16 May 2008 11:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18201#M3610</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-16T11:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the ODS escapechar with the excelXP tagset?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18202#M3611</link>
      <description>Hi:&lt;BR /&gt;
  I agree with Peter. There's no guarantee, that even if Escapechar did work for changing style, etc, that Escapechar+n would write the same thing that Excel writes for the Alt+Enter (which is what you have to use to put a return into an Excel cell -- outside the world of SAS.)&lt;BR /&gt;
&lt;BR /&gt;
  In fact, when I made a test spreadsheet and saved the file as XML, this is what I got from Excel (in the XML) for the cell:&lt;BR /&gt;
[pre]&lt;BR /&gt;
    &lt;CELL styleid="s21"&gt;&lt;DATA type="String"&gt;ccc &amp;amp;#10;ddd&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
It looks to me like &amp;amp;#10; is some kind of named entity (like &amp;nbsp;) that represents ALT+Enter.&lt;BR /&gt;
&lt;BR /&gt;
It also looks like Excel is setting the Wrap attribute on the s21 style:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  &lt;STYLE id="s21"&gt;&amp;lt;br&amp;gt;
   &amp;lt;Alignment ss:Vertical="Bottom" ss:WrapText="1"/&amp;gt;&amp;lt;br&amp;gt;
  &lt;/STYLE&gt;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
But, when I tried to use that string in a cell, even with protectspecialchars=off, Excel did not translate my &amp;amp;#10; to a return. Perhaps there is a hex code equivalent of that string which would work better. I frequently find that some things Microsoft does in its own XML I am unable to duplicate.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 16 May 2008 12:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18202#M3611</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-05-16T12:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the ODS escapechar with the excelXP tagset?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18203#M3612</link>
      <description>Hi:&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the help.  I got it to work by specifying protectspecialchar=no and using the actual CR value instead of the ods escapechar (replace the "?" with a "&amp;amp;").  What are the consequences of  my turning off protectspecialchar?  Can I get around any potential issues by just using the htmlencode function? &lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
  x = "aaa?#10;bbb";&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc template;&lt;BR /&gt;
  define style styles.test;&lt;BR /&gt;
  parent=styles.sasweb;&lt;BR /&gt;
    replace Document from Container /&lt;BR /&gt;
      protectspecialchars = off&lt;BR /&gt;
      ;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
ods tagsets.excelXP file="C:\temp\test.xls" style=styles.sasweb style=styles.test options (sheet_name= "test");&lt;BR /&gt;
&lt;BR /&gt;
proc print data=WORK.test noobs;&lt;BR /&gt;
  var x;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
ods listing;</description>
      <pubDate>Fri, 16 May 2008 14:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18203#M3612</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-16T14:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the ODS escapechar with the excelXP tagset?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18204#M3613</link>
      <description>Jack:&lt;BR /&gt;
  For what you're doing, I suspect there are no real consequences to using protectspecialchars=off. Generally, when protectspecialchars=on, a character like &amp;gt; used in a TITLE:&lt;BR /&gt;
[pre]title 'Sales &amp;gt; 500';[/pre]&lt;BR /&gt;
&lt;BR /&gt;
would be "protected" by being translated to &amp;amp;gt;  Of course, only you know your data and how important it is to have a CR in your data. It's a tradeoff. And benchmarking or thoroughly reviewing your output is the only method that can reveal the consequences of protectspecialchars=off.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Sat, 17 May 2008 15:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-I-use-the-ODS-escapechar-with-the-excelXP-tagset/m-p/18204#M3613</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-05-17T15:59:44Z</dc:date>
    </item>
  </channel>
</rss>

