<?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 can I prevent Character data from being converted to numeric in Excel? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-can-I-prevent-Character-data-from-being-converted-to-numeric/m-p/630646#M23832</link>
    <description>Thank you so much Patrick!!! This worked perfectly!! It's much appreciated!&lt;BR /&gt;Amrita</description>
    <pubDate>Mon, 09 Mar 2020 14:31:33 GMT</pubDate>
    <dc:creator>amritasingh</dc:creator>
    <dc:date>2020-03-09T14:31:33Z</dc:date>
    <item>
      <title>How can I prevent Character data from being converted to numeric in Excel?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-can-I-prevent-Character-data-from-being-converted-to-numeric/m-p/630508#M23830</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some numeric data that has more than 16 significant decimal places. So I read them in as character variables and am using ODS Excel with Proc Print to write out a report. The character variables print fine in the listing with all the significant decimals. However in the excel output file they get converted to numeric and get rounded. Is there any way to avoid that and print out the full number as text in the Excel file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;data rpt;&lt;BR /&gt;infile in dsd dlm=',' truncover firstobs=2;&lt;BR /&gt;input&lt;BR /&gt;&amp;nbsp; &amp;nbsp; minscore&amp;nbsp; &amp;nbsp; &amp;nbsp; :$char25.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; maxscore&amp;nbsp; &amp;nbsp; &amp;nbsp;:$char25.&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS excel FILE="\\mcksas4\amrita\Files\Model Segment Counts.xlsx"&amp;nbsp; STYLE=excel;&lt;/P&gt;&lt;P&gt;proc print data=rpt noobs;&lt;BR /&gt;var minscore maxscore;&lt;BR /&gt;format minscore maxscore $25.;&lt;BR /&gt;ods excel close;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Sample input data:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Minscore&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Maxscore&amp;nbsp;&lt;/P&gt;&lt;P&gt;0.2750573833205815&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.3476960152906469&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Proc print output in listing:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Minimum Score&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Maximum Score&lt;/P&gt;&lt;P&gt;0.2750573833205815&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.3476960152906469&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Proc print output in Excel file:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Minimum Score&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Maximum Score&lt;BR /&gt;0.275057383&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.347696015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Amrita&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2020 18:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-can-I-prevent-Character-data-from-being-converted-to-numeric/m-p/630508#M23830</guid>
      <dc:creator>amritasingh</dc:creator>
      <dc:date>2020-03-08T18:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I prevent Character data from being converted to numeric in Excel?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-can-I-prevent-Character-data-from-being-converted-to-numeric/m-p/630582#M23831</link>
      <description>&lt;P&gt;Below should work. Based on &lt;A href="http://support.sas.com/kb/57/620.html" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS excel FILE="\\mcksas4\amrita\Files\Model Segment Counts.xlsx"  STYLE=excel;

proc print data=rpt noobs;
  var minscore / style(data)={tagattr="type:String"};
  var maxscore / style(data)={tagattr="type:String"};
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2020 07:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-can-I-prevent-Character-data-from-being-converted-to-numeric/m-p/630582#M23831</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-09T07:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I prevent Character data from being converted to numeric in Excel?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-can-I-prevent-Character-data-from-being-converted-to-numeric/m-p/630646#M23832</link>
      <description>Thank you so much Patrick!!! This worked perfectly!! It's much appreciated!&lt;BR /&gt;Amrita</description>
      <pubDate>Mon, 09 Mar 2020 14:31:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-can-I-prevent-Character-data-from-being-converted-to-numeric/m-p/630646#M23832</guid>
      <dc:creator>amritasingh</dc:creator>
      <dc:date>2020-03-09T14:31:33Z</dc:date>
    </item>
  </channel>
</rss>

