<?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: Excel converts string to numeric in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93913#M26620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excel determines the format of the column based on the first few rows (first 5 I think). If the value in these rows is in a different format to those in the rest, incorrect format might result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding a single quote, which you have done, usually works. If not, I tend to apply a desired format to that column after importing in SAS and it works fine. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Feb 2013 13:27:04 GMT</pubDate>
    <dc:creator>VD</dc:creator>
    <dc:date>2013-02-01T13:27:04Z</dc:date>
    <item>
      <title>Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93912#M26619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does any one know of a solution to stop Excel converting string values such as "001" to a numeric field of 1? I've tried several combinations to try and fix the issue including adding a dummy row with values of "000 (dummy)" and this works for the active row but not for subsequent rows. Also tried adding a single quote of the start of the string (" '001") and this works but the output is '001 which isnt ideal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. I'm running on SAS 9.1.3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 09:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93912#M26619</guid>
      <dc:creator>Mikeyjh</dc:creator>
      <dc:date>2013-02-01T09:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93913#M26620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excel determines the format of the column based on the first few rows (first 5 I think). If the value in these rows is in a different format to those in the rest, incorrect format might result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding a single quote, which you have done, usually works. If not, I tend to apply a desired format to that column after importing in SAS and it works fine. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 13:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93913#M26620</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2013-02-01T13:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93914#M26621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;are you importing or exporting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 13:30:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93914#M26621</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-01T13:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93915#M26622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Importing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 13:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93915#M26622</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2013-02-01T13:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93916#M26623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I usually add 2 or 3 dummy rows (characters). It wound not work when you add 000 as dummy row.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 13:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93916#M26623</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-02-01T13:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93917#M26624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;using enterprise guide wizard or coding directly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 13:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93917#M26624</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-01T13:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93918#M26625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Coding - I find it much easier than using the wizard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 13:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93918#M26625</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2013-02-01T13:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93919#M26626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using coding directly and exporting to excel using ODS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin - so you would suggest creating several dummy rows to force Excel to handle the column as a text field?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 13:57:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93919#M26626</guid>
      <dc:creator>Mikeyjh</dc:creator>
      <dc:date>2013-02-01T13:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93920#M26627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. That is what I do when I work with excel files.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 14:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93920#M26627</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-02-01T14:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93921#M26628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry...I got confused about the direction.&amp;nbsp; You're importing into Excel...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've seen it done via HTML by formatting the cell as TEXT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html file='temp.xls';&lt;/P&gt;&lt;P&gt;proc print data=one;&lt;/P&gt;&lt;P&gt;var acct_no / style={htmlstyle="vnd.msexcel.numberformat:@"};&lt;/P&gt;&lt;P&gt;var zipcode;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods html close;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another option I've seen is to use ="001" rather than the '.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 14:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93921#M26628</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-01T14:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93922#M26629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i find some short cut in excel only...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it will give FOUR zeros for&amp;nbsp; before the number...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the screen shot...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALLU&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 15:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93922#M26629</guid>
      <dc:creator>allurai0412</dc:creator>
      <dc:date>2013-02-01T15:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93923#M26630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Regarding using ODS to go &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt; &lt;STRONG&gt;SAS&lt;/STRONG&gt;&lt;/SPAN&gt; to Excel -- depending on your ODS destination, you can use either HTMLSTYLE or TAGATTR to pass Microsoft-specific formats from SAS to Excel. See this user group paper for detailed information about using either HTML-based destinations or XML-based destinations to have your numbers (such as leading zeroes, decimal points, etc) treated correctly when Excel opens the ODS result file.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings11/266-2011.pdf" title="http://support.sas.com/resources/papers/proceedings11/266-2011.pdf"&gt;http://support.sas.com/resources/papers/proceedings11/266-2011.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Technically, when you use ODS to send results to Excel, you are just creating an ASCII text file that Excel knows how to open and render. That ODS result file is NOT a true, biinary Excel file. Only PROC EXPORT or the LIBNAME engine can create true, binary Excel format data files. The advantage of using ODS is that with HTML-based or XML-based result output, you can add colors and fonts and style formatting to your worksheets AND, you can send Microsoft formats from SAS to Excel -- which you cannot do with the LIBNAME engine or PROC EXPORT).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About an import &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;from&lt;/STRONG&gt; &lt;STRONG&gt;Excel&lt;/STRONG&gt;&lt;/SPAN&gt; to SAS, you either use PROC IMPORT, or the LIBNAME engine, or use your own code to read the data from Excel into SAS and transform you variables from numeric to character or vice versa. Using code gives you the kind of control you want over informats and variable types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Feb 2013 15:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93923#M26630</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-02-02T15:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Excel converts string to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93924#M26631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Recommended reading from Cynthia &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2013 17:54:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Excel-converts-string-to-numeric/m-p/93924#M26631</guid>
      <dc:creator>Mikeyjh</dc:creator>
      <dc:date>2013-02-03T17:54:14Z</dc:date>
    </item>
  </channel>
</rss>

