<?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: find numbers from string in macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/find-numbers-from-string-in-macro/m-p/301324#M63734</link>
    <description>&lt;P&gt;You will need to find a new plan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro language does not process values within a SAS data set.&amp;nbsp; You would have to first create a set of macro variables from the data values, and then macro language could examine them one by one.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2016 15:42:39 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-09-28T15:42:39Z</dc:date>
    <item>
      <title>find numbers from string in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-numbers-from-string-in-macro/m-p/301316#M63731</link>
      <description>&lt;P&gt;Hi &amp;nbsp;All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data as&amp;nbsp;below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LAB_RESULT1&lt;/P&gt;&lt;P&gt;LAB_UNITS&lt;/P&gt;&lt;P&gt;LAB_HI1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find out the string which contain numbers at any position in string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the same in macro only and in macro anydigit is not working for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 15:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-numbers-from-string-in-macro/m-p/301316#M63731</guid>
      <dc:creator>draroda</dc:creator>
      <dc:date>2016-09-28T15:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: find numbers from string in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-numbers-from-string-in-macro/m-p/301319#M63732</link>
      <description>&lt;P&gt;Yes, anydigit() will not work straight off, you could put it in %sysfunc(), but that has limited functions it supports. &amp;nbsp;The simple point here is the Macro language is NOT the programming language. &amp;nbsp;It is a text generation tool. &amp;nbsp;Base SAS is THE programming language, it has all the data types, the functions, the procedures. &amp;nbsp;Use the right tool for the right job, you wouldn't believe how many questions take the form "Have to use macro, not working", and the answer is always use Base SAS. &amp;nbsp;If you abosultely have to have the string in macro then:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  if anydigit("&amp;amp;VALUE.") then res=1;
  else res=0;
  call symput('res',res);
run;

...
%if &amp;amp;res. %then %do;
...&lt;/PRE&gt;
&lt;P&gt;This combines Base SAS step with macro variables.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 15:34:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-numbers-from-string-in-macro/m-p/301319#M63732</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-09-28T15:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: find numbers from string in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-numbers-from-string-in-macro/m-p/301324#M63734</link>
      <description>&lt;P&gt;You will need to find a new plan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro language does not process values within a SAS data set.&amp;nbsp; You would have to first create a set of macro variables from the data values, and then macro language could examine them one by one.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 15:42:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-numbers-from-string-in-macro/m-p/301324#M63734</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-28T15:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: find numbers from string in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-numbers-from-string-in-macro/m-p/301329#M63736</link>
      <description>&lt;P&gt;And to add to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding﻿&lt;/a&gt;'s very important comment, you would have to multiple the complexity severely if there are other pieces of information needed such as the values of other variables.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 15:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-numbers-from-string-in-macro/m-p/301329#M63736</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-28T15:50:18Z</dc:date>
    </item>
  </channel>
</rss>

