<?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 Retaining digits as character in Excel in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Retaining-digits-as-character-in-Excel/m-p/66774#M7740</link>
    <description>Hello,&lt;BR /&gt;
I am using an ods html statement to move output from proc print into MS Excel.  One variable is 5 digits, which is defined as character (created using put statement). When it moves to Excel, it reverts to numeric. Thus I loose any leading zeros.  How can I retain the 5 digits as character in excel?&lt;BR /&gt;
Thanks</description>
    <pubDate>Tue, 24 Aug 2010 14:37:10 GMT</pubDate>
    <dc:creator>natanya</dc:creator>
    <dc:date>2010-08-24T14:37:10Z</dc:date>
    <item>
      <title>Retaining digits as character in Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Retaining-digits-as-character-in-Excel/m-p/66774#M7740</link>
      <description>Hello,&lt;BR /&gt;
I am using an ods html statement to move output from proc print into MS Excel.  One variable is 5 digits, which is defined as character (created using put statement). When it moves to Excel, it reverts to numeric. Thus I loose any leading zeros.  How can I retain the 5 digits as character in excel?&lt;BR /&gt;
Thanks</description>
      <pubDate>Tue, 24 Aug 2010 14:37:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Retaining-digits-as-character-in-Excel/m-p/66774#M7740</guid>
      <dc:creator>natanya</dc:creator>
      <dc:date>2010-08-24T14:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Retaining digits as character in Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Retaining-digits-as-character-in-Excel/m-p/66775#M7741</link>
      <description>Suggest checking the forum archives, also the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website for SAS-hosted DOC and supplemental technical / conference material.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
export excel retain leading zeros site:sas.com</description>
      <pubDate>Tue, 24 Aug 2010 15:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Retaining-digits-as-character-in-Excel/m-p/66775#M7741</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-24T15:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Retaining digits as character in Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Retaining-digits-as-character-in-Excel/m-p/66776#M7742</link>
      <description>Hi:&lt;BR /&gt;
  As Scott suggests, searching the forum archives is a great idea, since there have been many previous forum postings on this topic. Basically, Excel does not respect SAS formats for leading zeroes -- even if the number is a character value in the SAS end of things, if Excel detects numbers, it applies a General number format to the cell which strips any leading zeroes. This is Microsoft behavior and the only way to impact the behavior is to send a &lt;B&gt;&lt;U&gt;Microsoft&lt;/U&gt;&lt;/B&gt;&lt;U&gt;&lt;/U&gt; format from SAS to Excel.&lt;BR /&gt;
&lt;BR /&gt;
  You can either use a format to tell Excel that the number is a character variable or you can use a format to just put leading zeroes into the number. With HTML-based destinations, the HTMLSTYLE= style attribute is the way you would send a Microsoft format from SAS to Excel. &lt;BR /&gt;
&lt;BR /&gt;
  These two previous forum postings show how to use HTMLSTYLE:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=41019ꀻ" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=41019ꀻ&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=8753∱" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=8753∱&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  Do note that in SAS 9, you may want to use ODS MSOFFICE2K instead of ODS HTML -- because MSOFFICE2K uses Microsoft flavor of HTML tags and Excel is "happier" rendering those tags instead of ODS HTML tags which are HTML 4.0 tags (and Excel doesn't like those tags as well).&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 24 Aug 2010 15:24:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Retaining-digits-as-character-in-Excel/m-p/66776#M7742</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-08-24T15:24:19Z</dc:date>
    </item>
  </channel>
</rss>

