<?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: character variable (containing letter) to numeric variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/character-variable-containing-letter-to-numeric-variable/m-p/194651#M36600</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Converting to numeric requires defining a new variable, but the code is simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newvar = input(oldvar, ??5.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question marks suppress messages about invalid data that would have been generated when encountering letters.&amp;nbsp; The new variable will have a missing value for those observations that can't be converted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Apr 2015 17:07:58 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2015-04-13T17:07:58Z</dc:date>
    <item>
      <title>character variable (containing letter) to numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-variable-containing-letter-to-numeric-variable/m-p/194650#M36599</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 have a question about converting character variable to numeric variable in SAS. My data set contains a character variable, which is five (5) digits and each digit may be letter or number. Now I want to convert the variable to numeric (actually only the ones &lt;SPAN style="font-size: 13.3333330154419px;"&gt;with all five digits work well to be convert to numerical, &lt;/SPAN&gt;and also keep others with letter as they are used to be). How to combine this condition with input function or is there any other way to do? Thanks much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Michelle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 16:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-variable-containing-letter-to-numeric-variable/m-p/194650#M36599</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-04-13T16:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: character variable (containing letter) to numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-variable-containing-letter-to-numeric-variable/m-p/194651#M36600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Converting to numeric requires defining a new variable, but the code is simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newvar = input(oldvar, ??5.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question marks suppress messages about invalid data that would have been generated when encountering letters.&amp;nbsp; The new variable will have a missing value for those observations that can't be converted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 17:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-variable-containing-letter-to-numeric-variable/m-p/194651#M36600</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-04-13T17:07:58Z</dc:date>
    </item>
  </channel>
</rss>

