<?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 how can I find these values are numeric from a char variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285298#M58290</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
 if  substr(icd, 1,3) in ( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9') then num ="Y";else num ="N";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;my code does not work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any ideas on how to modify?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2016 17:21:40 GMT</pubDate>
    <dc:creator>Bal23</dc:creator>
    <dc:date>2016-07-18T17:21:40Z</dc:date>
    <item>
      <title>how can I find these values are numeric from a char variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285298#M58290</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
 if  substr(icd, 1,3) in ( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9') then num ="Y";else num ="N";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;my code does not work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any ideas on how to modify?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 17:21:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285298#M58290</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-07-18T17:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: how can I find these values are numeric from a char variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285305#M58292</link>
      <description>&lt;P&gt;Have you run PROC CONTENTS? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 17:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285305#M58292</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2016-07-18T17:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: how can I find these values are numeric from a char variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285306#M58293</link>
      <description>&lt;P&gt;I haven't used it, but perhaps NOTDIGT() is a possibility:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;184  data _null_;
185    input text $;
186    if notdigit(trim(text))=0 then num="Y";
187    else num="N";
188    put (text num)(=);
189    cards;

text=hello num=N
text=123 num=Y
text=1 num=Y
text=4,321 num=N
text=1.5 num=N
text=m1m num=N

196  ;
197  run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that should work, nof by numeric you mean contains only numbers.&amp;nbsp; As shown above, characters such as comma or decimal point are considered non-numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;--Q.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 17:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285306#M58293</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-07-18T17:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: how can I find these values are numeric from a char variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285308#M58294</link>
      <description>&lt;P&gt;Clearly, this code will rarely work.&amp;nbsp; It examines the first three characters in your variable to specifically see if the first character is a digit and the second and third characters are both blanks.&amp;nbsp; I doubt that is what you wanted to accomplish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What did you want to accomplish?&amp;nbsp; You will have to explain it in words, rather than show code that doesn't work.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 17:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285308#M58294</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-07-18T17:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: how can I find these values are numeric from a char variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285309#M58295</link>
      <description>&lt;P&gt;you are right, i found this problem and fixed it thanks&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 17:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-find-these-values-are-numeric-from-a-char-variable/m-p/285309#M58295</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-07-18T17:47:02Z</dc:date>
    </item>
  </channel>
</rss>

