<?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: Converting a character variable into a numeric variable in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80911#M718</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;You are on the right path. input() will convert the character variable into numeric. it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x=input(Cust_No, 8.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so are you trying that in sql, could you please send me the code you have used in sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Jan 2013 15:02:53 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2013-01-21T15:02:53Z</dc:date>
    <item>
      <title>Converting a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80909#M716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to convert a character variable into a numeric variable, by means of an expression in an Extract transformation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The character variable is called Cust_No, and has the format $8. It needs to become a numeric variable with the format 8.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I accomplish this? I'm going insane experimenting with PUT, PUTC, PUTN, INPUT, INPUTN, INPUTC, etc. Whenever I think I've done it, the SQL Join tells me that I have the wrong data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought it would be correct to use this: input(Cust_No, 8.)&amp;nbsp;&amp;nbsp; However, that just turns all the values blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. &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>Mon, 21 Jan 2013 14:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80909#M716</guid>
      <dc:creator>EinarRoed</dc:creator>
      <dc:date>2013-01-21T14:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80910#M717</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;Have you tried this:&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set your_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_Cust_no = Cust_no * 1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 14:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80910#M717</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-01-21T14:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80911#M718</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;You are on the right path. input() will convert the character variable into numeric. it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x=input(Cust_No, 8.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so are you trying that in sql, could you please send me the code you have used in sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 15:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80911#M718</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-01-21T15:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80912#M719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. For some reason, when I do either of those things, the variable becomes blank, as though it refuses to be numeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Out of curiosity, should I be able to do an inner join on character variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 15:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80912#M719</guid>
      <dc:creator>EinarRoed</dc:creator>
      <dc:date>2013-01-21T15:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80913#M720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you should be able to do inner join on character variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you, please, share the code?&lt;/P&gt;&lt;P&gt;And a small sample data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about&lt;/P&gt;&lt;P&gt;new_var = input(old_var,&lt;STRONG&gt;best.&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 15:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80913#M720</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-01-21T15:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80914#M721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like your character variable is either blank or is longer than 8 characters and is right aligned so that the first 8 positions are blank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 19:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80914#M721</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-01-21T19:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80915#M722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Resolved it using characters instead. Thanks for your advise though, I learned something. &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>Mon, 21 Jan 2013 21:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-a-character-variable-into-a-numeric-variable/m-p/80915#M722</guid>
      <dc:creator>EinarRoed</dc:creator>
      <dc:date>2013-01-21T21:22:49Z</dc:date>
    </item>
  </channel>
</rss>

