<?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 the word form the string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extract-the-word-form-the-string/m-p/486022#M126361</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(keep = unit);
set have;
unit = substr(drug1,anydigit(drug1));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;</description>
    <pubDate>Sat, 11 Aug 2018 09:46:39 GMT</pubDate>
    <dc:creator>s_manoj</dc:creator>
    <dc:date>2018-08-11T09:46:39Z</dc:date>
    <item>
      <title>Extract the word form the string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-the-word-form-the-string/m-p/486020#M126359</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here I have a sample dataset, I want to extract the gram/milligram values from the string.&lt;/P&gt;&lt;P&gt;I tried up with compress method, but even I need more efficient step to extract in particular format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input drug1$30.;
cards;
metformin 500MG
Glycopride 250mg
GLYCOMET 1GM
gLYCOMET 1GM
GLYCIPHAGE 850MG
GLYCIPHAGE 500mg
;
run;

data want;
set have;
d1 = compress(drug1,'1234567890mgMG','k');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SAS Output&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs drug1 d1123456 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;metformin 500MG&lt;/TD&gt;&lt;TD&gt;mm500MG&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Glycopride 250mg&lt;/TD&gt;&lt;TD&gt;G250mg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GLYCOMET 1GM&lt;/TD&gt;&lt;TD&gt;GM1GM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;gLYCOMET 1GM&lt;/TD&gt;&lt;TD&gt;gM1GM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GLYCIPHAGE 850MG&lt;/TD&gt;&lt;TD&gt;GG850MG&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GLYCIPHAGE 500mg&lt;/TD&gt;&lt;TD&gt;GG500mg&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Expected Output&amp;nbsp;&lt;/P&gt;&lt;P&gt;500MG&lt;/P&gt;&lt;P&gt;250mg&lt;/P&gt;&lt;P&gt;1GM&lt;/P&gt;&lt;P&gt;850MG&lt;/P&gt;&lt;P&gt;500mg&lt;/P&gt;&lt;P&gt;Please suggest the code which extract the output in the given format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE : To more simpler, Atleast let me know how to remove the characters in front of numeric value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Aug 2018 09:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-the-word-form-the-string/m-p/486020#M126359</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2018-08-11T09:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the word form the string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-the-word-form-the-string/m-p/486022#M126361</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(keep = unit);
set have;
unit = substr(drug1,anydigit(drug1));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;</description>
      <pubDate>Sat, 11 Aug 2018 09:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-the-word-form-the-string/m-p/486022#M126361</guid>
      <dc:creator>s_manoj</dc:creator>
      <dc:date>2018-08-11T09:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the word form the string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-the-word-form-the-string/m-p/486024#M126362</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;d1 = scan(drug1,-1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Aug 2018 10:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-the-word-form-the-string/m-p/486024#M126362</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-11T10:52:56Z</dc:date>
    </item>
  </channel>
</rss>

