<?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 Need help in Finding a sub string which is in a particular format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Need-help-in-Finding-a-sub-string-which-is-in-a-particular/m-p/186418#M47332</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a character string&amp;nbsp; which contains the words with the combination of characters, numbers and special character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would like to find/extract only the particular string which is in below mentioned format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input string :&amp;nbsp; " 10% discount to be given to accidental insurance customers in 9874-04562 on a pro rata basis"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output Sub string&amp;nbsp; : 9874-04562&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Oct 2014 06:05:27 GMT</pubDate>
    <dc:creator>RaviKommuri</dc:creator>
    <dc:date>2014-10-16T06:05:27Z</dc:date>
    <item>
      <title>Need help in Finding a sub string which is in a particular format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-help-in-Finding-a-sub-string-which-is-in-a-particular/m-p/186418#M47332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a character string&amp;nbsp; which contains the words with the combination of characters, numbers and special character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would like to find/extract only the particular string which is in below mentioned format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input string :&amp;nbsp; " 10% discount to be given to accidental insurance customers in 9874-04562 on a pro rata basis"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output Sub string&amp;nbsp; : 9874-04562&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 06:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-help-in-Finding-a-sub-string-which-is-in-a-particular/m-p/186418#M47332</guid>
      <dc:creator>RaviKommuri</dc:creator>
      <dc:date>2014-10-16T06:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in Finding a sub string which is in a particular format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-help-in-Finding-a-sub-string-which-is-in-a-particular/m-p/186419#M47333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use regular expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if _N_ = 1 then &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain rId;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rId = prxparse('/\d{4}-\d{5}/');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; str = ' 10% discount to be given to accidental insurance customers in 9874-04562 on a pro rata basis';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call prxsubstr(rId, str, pos, len);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if pos ^= 0 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; match = substr(str, pos, len);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put match=;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 06:17:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-help-in-Finding-a-sub-string-which-is-in-a-particular/m-p/186419#M47333</guid>
      <dc:creator>Vladislaff</dc:creator>
      <dc:date>2014-10-16T06:17:52Z</dc:date>
    </item>
  </channel>
</rss>

