<?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 a sentence in a string that has a word in different forms in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348707#M273461</link>
    <description>&lt;P&gt;You can use fuzzy searching methods as described in this article:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sgf/2015/01/27/how-to-perform-a-fuzzy-match-using-sas-functions/" target="_blank"&gt;http://blogs.sas.com/content/sgf/2015/01/27/how-to-perform-a-fuzzy-match-using-sas-functions/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 13:57:17 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-04-10T13:57:17Z</dc:date>
    <item>
      <title>Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348699#M273460</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you all had a good weekend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This question is similar to the one I posted last week but I ned help in making&amp;nbsp;the code more robust.&lt;/P&gt;&lt;P&gt;Could you please help in extracting sentences that had a word in several forms?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Say all sentences with different forms of word 'experience'? &amp;nbsp;like experience, ExperiEnce-based, Experienced, Experiencing and so on? Can we get the desired results using regex coding?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the link to the question&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Extra-a-sentence-in-a-string-that-has-a-specific-word/m-p/348363#M44886" target="_self"&gt;https://communities.sas.com/t5/General-SAS-Programming/Extra-a-sentence-in-a-string-that-has-a-specific-word/m-p/348363#M44886&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot, appreciate the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhuvana&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 13:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348699#M273460</guid>
      <dc:creator>Bhuvaneswari</dc:creator>
      <dc:date>2017-04-10T13:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348707#M273461</link>
      <description>&lt;P&gt;You can use fuzzy searching methods as described in this article:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sgf/2015/01/27/how-to-perform-a-fuzzy-match-using-sas-functions/" target="_blank"&gt;http://blogs.sas.com/content/sgf/2015/01/27/how-to-perform-a-fuzzy-match-using-sas-functions/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 13:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348707#M273461</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-04-10T13:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348709#M273462</link>
      <description>&lt;P&gt;It looks like you already have code to pick out one sentence at a time.&amp;nbsp; The easy way to make the code more robust would be to use the FIND function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if find(sentence, 'experience', 'i') &amp;gt; 0 then ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While you could use INDEX instead of FIND, the advantage of FIND is that you can add the "i" modifier to ignore differences in case.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 14:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348709#M273462</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T14:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348718#M273463</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response, I used that but it is not picking sentences that either have hyphen like 'experince-based'.&lt;/P&gt;&lt;P&gt;For instance, the code below is not picking the first sentence&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data example;&lt;BR /&gt;comment ="The worst experience-based I've ever had with them. The worst service in a decade. Because of this experience I will not be recommending this gym." ;&lt;BR /&gt;length extract sentence $200.;&lt;BR /&gt;do i = 1 to countw(comment,'.');&lt;BR /&gt;sentence = scan(comment,i,'.');&lt;BR /&gt;if findw( sentence,'Experience',' .,/','i')&amp;gt;0 then do;&lt;BR /&gt;extract= catx(' ',extract,catt(sentence,'.')) ;&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;drop sentence i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advice on how to proceed further. The data I'm working on is not so well written hence I want the code to extract the words that are somewhere in the middle of the strings even if there is no space, say 'CauseExperience-Based' and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 14:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348718#M273463</guid>
      <dc:creator>Bhuvaneswari</dc:creator>
      <dc:date>2017-04-10T14:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348726#M273464</link>
      <description>&lt;P&gt;Don't switch to FINDW.&amp;nbsp; Use FIND.&amp;nbsp; It will find the characters, not the word.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 14:52:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348726#M273464</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T14:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348732#M273465</link>
      <description>&lt;P&gt;Switching to find() intead of findw() is returing a null string. Please advice.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348732#M273465</guid>
      <dc:creator>Bhuvaneswari</dc:creator>
      <dc:date>2017-04-10T15:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348733#M273466</link>
      <description>&lt;P&gt;You'll have to show what you actually did here.&amp;nbsp; (For example, it might be that the third parameter to FIND must be removed, the way it appears in my original post.)&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348733#M273466</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T15:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348737#M273467</link>
      <description>&lt;P&gt;That worked! thanks a ton :). Can you please tell me how the find() could pick only the sentence that has the word in it without expliciply mentioning the delimiter? What if I want to change the delimiter to somthing other than period?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for the assistance!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348737#M273467</guid>
      <dc:creator>Bhuvaneswari</dc:creator>
      <dc:date>2017-04-10T15:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348741#M273468</link>
      <description>&lt;P&gt;With FIND, there are no delimiters.&amp;nbsp; It is looking for that sequence of characters anywhere in the sentence.&amp;nbsp; With a long word like "experience" that shouldn't cause any issues.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348741#M273468</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T15:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a sentence in a string that has a word in different forms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348743#M273469</link>
      <description>&lt;P&gt;Thanks for the help! Have a good day!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-a-sentence-in-a-string-that-has-a-word-in-different/m-p/348743#M273469</guid>
      <dc:creator>Bhuvaneswari</dc:creator>
      <dc:date>2017-04-10T15:16:16Z</dc:date>
    </item>
  </channel>
</rss>

