<?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: Extract only the first numeric value from string with mutliple numeric occurence in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492184#M72211</link>
    <description>&lt;P&gt;Many thanks for the advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some complicated situation as follows couldn't be solved.&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"1-2 times in 1 week"&lt;/P&gt;&lt;P&gt;Expected Output:1&lt;/P&gt;&lt;P&gt;Using the above code: 12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Sep 2018 05:02:30 GMT</pubDate>
    <dc:creator>nicolaskan</dc:creator>
    <dc:date>2018-09-04T05:02:30Z</dc:date>
    <item>
      <title>Extract only the first numeric value from string with mutliple numeric occurence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492171#M72206</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May i know if there are any simple way to extract first numeric digit in a string with mix of number and string?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column: Text1&lt;/P&gt;&lt;P&gt;Value of Text1: "2 times in 1 week"&lt;/P&gt;&lt;P&gt;Expected Output: 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to use the following script yet it combines two numeric value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output_value = COMPRESS(SCAN(Text1,1),"abcdefghijklmnopqrstuvwxyz`~*!@#$%^*()-_=+\|[]{};:',.&amp;lt;&amp;gt;?/ " , "i");&lt;/P&gt;&lt;P&gt;=&amp;gt; Output: 21 (i.e. I would like to extract 2 only)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May i know if anyone can help?&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 03:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492171#M72206</guid>
      <dc:creator>nicolaskan</dc:creator>
      <dc:date>2018-09-04T03:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only the first numeric value from string with mutliple numeric occurence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492172#M72207</link>
      <description>&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;want=char(var,anydigit(var));&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 04:02:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492172#M72207</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-04T04:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only the first numeric value from string with mutliple numeric occurence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492174#M72208</link>
      <description>&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;&lt;P&gt;however, it doesn't solve the case like&lt;/P&gt;&lt;P&gt;"10 times in 1 week"&lt;/P&gt;&lt;P&gt;=&amp;gt; it will output 1 instead of 10 in this case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 04:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492174#M72208</guid>
      <dc:creator>nicolaskan</dc:creator>
      <dc:date>2018-09-04T04:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only the first numeric value from string with mutliple numeric occurence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492175#M72209</link>
      <description>&lt;P&gt;sorry my fault. brb&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 04:08:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492175#M72209</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-04T04:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only the first numeric value from string with mutliple numeric occurence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492178#M72210</link>
      <description>&lt;P&gt;my sincere apologies for the lack of attention to detail&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
k='"10 times in 1 week"';
want=scan(compress(k,' ','kd'),1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Sep 2018 04:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492178#M72210</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-04T04:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only the first numeric value from string with mutliple numeric occurence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492184#M72211</link>
      <description>&lt;P&gt;Many thanks for the advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some complicated situation as follows couldn't be solved.&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"1-2 times in 1 week"&lt;/P&gt;&lt;P&gt;Expected Output:1&lt;/P&gt;&lt;P&gt;Using the above code: 12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 05:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492184#M72211</guid>
      <dc:creator>nicolaskan</dc:creator>
      <dc:date>2018-09-04T05:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only the first numeric value from string with mutliple numeric occurence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492185#M72212</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
k='1-2 times in 1 week';
want=scan(compress(k,'  -','kd'),1);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;better is to apply regex though using prx functions&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 05:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492185#M72212</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-04T05:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only the first numeric value from string with mutliple numeric occurence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492186#M72213</link>
      <description>&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
k='1-2 times in 1 week';
want=scan(compress(k,' ','kdp'),1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Sep 2018 05:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492186#M72213</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-04T05:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only the first numeric value from string with mutliple numeric occurence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492191#M72215</link>
      <description>&lt;P&gt;Thanks a lot for the valuable advice.&lt;/P&gt;&lt;P&gt;It helps.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 05:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-only-the-first-numeric-value-from-string-with-mutliple/m-p/492191#M72215</guid>
      <dc:creator>nicolaskan</dc:creator>
      <dc:date>2018-09-04T05:59:38Z</dc:date>
    </item>
  </channel>
</rss>

