<?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: Pulling Out Numeric Values from a Character Variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Pulling-Out-Numeric-Values-from-a-Character-Variable/m-p/294015#M61316</link>
    <description>&lt;P&gt;I was never aware of the ? and ?? format modifier until now. &amp;nbsp;Thank you so much!&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2016 13:22:11 GMT</pubDate>
    <dc:creator>djbateman</dc:creator>
    <dc:date>2016-08-25T13:22:11Z</dc:date>
    <item>
      <title>Pulling Out Numeric Values from a Character Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-Out-Numeric-Values-from-a-Character-Variable/m-p/294005#M61313</link>
      <description>&lt;P&gt;I have a list of lab values in a character variable, and I need to store all the numeric values in a numeric variable. &amp;nbsp;I thought I had it made when I found the NOTDIGIT() function. &amp;nbsp;That works great for integer data, but then I realized that I am dealing with decimal and negative values. &amp;nbsp;Is there a way to detect just these characters? &amp;nbsp;I know I could just use INPUT(). &amp;nbsp;That would convert any number-like value to numeric, but for all the character values, I would be left with a lot of ugly notes filling up my log (NOTE: Invalid argument to function INPUT at line XXX&amp;nbsp;column YYY.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some example data below. &amp;nbsp;Is there &amp;nbsp;away to&amp;nbsp;get LABVAL to the NUMLAB and CHARLAB, respectively, as I have them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;LABVAL&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;NUMLA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t;/TD&gt;&lt;TD&gt;YELLOW&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;lt; 2.5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;lt; 2.5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 25 Aug 2016 13:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-Out-Numeric-Values-from-a-Character-Variable/m-p/294005#M61313</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2016-08-25T13:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Out Numeric Values from a Character Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-Out-Numeric-Values-from-a-Character-Variable/m-p/294009#M61314</link>
      <description>&lt;P&gt;The easiest way would be to suppress all the usgly messages about invalid data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;numlab = input(labval, ??12.);&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 13:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-Out-Numeric-Values-from-a-Character-Variable/m-p/294009#M61314</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-08-25T13:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Out Numeric Values from a Character Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-Out-Numeric-Values-from-a-Character-Variable/m-p/294015#M61316</link>
      <description>&lt;P&gt;I was never aware of the ? and ?? format modifier until now. &amp;nbsp;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 13:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-Out-Numeric-Values-from-a-Character-Variable/m-p/294015#M61316</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2016-08-25T13:22:11Z</dc:date>
    </item>
  </channel>
</rss>

