<?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: Convert Character to Numberic in data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-Character-to-Numberic-in-data-step/m-p/406561#M99003</link>
    <description>Looks like you are OUTPUTing before you assign the new variables a value.</description>
    <pubDate>Mon, 23 Oct 2017 14:45:38 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2017-10-23T14:45:38Z</dc:date>
    <item>
      <title>Convert Character to Numberic in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Character-to-Numberic-in-data-step/m-p/406553#M99001</link>
      <description>&lt;P&gt;I've tried several solutions on here but I can't quite get the result needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am preparing to merge 2 tables, but before so I need to convert 10 fields from character to numeric.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error code that provoked this cry for help is.&amp;nbsp;&amp;nbsp; ERROR: Variable TMP has been defined as both character and numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get the variables TMP and DPT to change to numeric values, but depending on the format that I pick (best8, $char, etc) I will either get blanks or dots in the results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code is as follows:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data updt_data&lt;/P&gt;&lt;P&gt;updt_forecast;&lt;/P&gt;&lt;P&gt;set weath_updt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;if status = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"O"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; then output updt_data;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;else output updt_forecast;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;tmp_new=input(TMP,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;best8.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;dpt_new=input(DPT,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;best8.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;drop TMP;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rename tmp_new=TMP;&lt;/P&gt;&lt;P&gt;drop dpt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rename dpt_new=DPT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 14:39:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Character-to-Numberic-in-data-step/m-p/406553#M99001</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-10-23T14:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character to Numberic in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Character-to-Numberic-in-data-step/m-p/406561#M99003</link>
      <description>Looks like you are OUTPUTing before you assign the new variables a value.</description>
      <pubDate>Mon, 23 Oct 2017 14:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Character-to-Numberic-in-data-step/m-p/406561#M99003</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-10-23T14:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character to Numberic in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Character-to-Numberic-in-data-step/m-p/406567#M99006</link>
      <description>&lt;P&gt;A simple misstep can throw off the entire code.&amp;nbsp; Issue fixed, thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 14:50:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Character-to-Numberic-in-data-step/m-p/406567#M99006</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-10-23T14:50:03Z</dc:date>
    </item>
  </channel>
</rss>

