<?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: Index not finding string if there is a comma or dot etc after it in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564450#M158330</link>
    <description>&lt;P&gt;The mentioned solution is working, I've also used strip and it worked too...&lt;BR /&gt;&lt;BR /&gt;thanx &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2019 12:47:31 GMT</pubDate>
    <dc:creator>SIgnificatif</dc:creator>
    <dc:date>2019-06-07T12:47:31Z</dc:date>
    <item>
      <title>Index not finding string if there is a comma or dot etc after it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564443#M158326</link>
      <description>&lt;P&gt;Hi dear all.&lt;BR /&gt;&lt;BR /&gt;I have a basic function and I can't find what i'm looking for...&lt;BR /&gt;&lt;BR /&gt;the below code works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
re="all";
ro="hello";
ra=catx('',ro,re);
texto='blablabla hello all , people';
	if indexw(texto,ra)&amp;gt;0 then do;
	bi="wee";
	end;
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and this one not ... ( because there is a comma after 'all' in texto:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
re="all";
ro="hello";
ra=catx('',ro,re);
texto='blablabla hello all, people';
	if indexw(texto,ra)&amp;gt;0 then do;
	bi="wee";
	end;
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;how to fix that, to make the index or indexw find the word even if there is a comma, period etc after or before the searched word ( or series of words' like ro re... ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for the response.&lt;BR /&gt;&lt;BR /&gt;Sincerely.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 12:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564443#M158326</guid>
      <dc:creator>SIgnificatif</dc:creator>
      <dc:date>2019-06-07T12:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Index not finding string if there is a comma or dot etc after it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564445#M158327</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use Trim function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;re="all";&lt;BR /&gt;ro="hello";&lt;BR /&gt;ra=catx('',ro,re);&lt;BR /&gt;texto='blablabla hello all, people';&lt;BR /&gt;if index(texto,(trim(ra)))&amp;gt;0 then do;&lt;BR /&gt;bi="wee";&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anushree&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 12:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564445#M158327</guid>
      <dc:creator>anushreebiotech</dc:creator>
      <dc:date>2019-06-07T12:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Index not finding string if there is a comma or dot etc after it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564446#M158328</link>
      <description>&lt;P&gt;In your second code of texto attribute of value, space is removed &amp;nbsp;after "&lt;STRONG&gt;ALL".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thats why you are not getting result.&lt;/P&gt;&lt;P&gt;as per First code, Space is there after&amp;nbsp;&lt;STRONG&gt;ALL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;add space and then run.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 12:39:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564446#M158328</guid>
      <dc:creator>Riteshdell</dc:creator>
      <dc:date>2019-06-07T12:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Index not finding string if there is a comma or dot etc after it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564450#M158330</link>
      <description>&lt;P&gt;The mentioned solution is working, I've also used strip and it worked too...&lt;BR /&gt;&lt;BR /&gt;thanx &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 12:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564450#M158330</guid>
      <dc:creator>SIgnificatif</dc:creator>
      <dc:date>2019-06-07T12:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Index not finding string if there is a comma or dot etc after it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564503#M158362</link>
      <description>&lt;P&gt;INDEXW has an options parameter to contain delimiters. The default delimiter is blank.&lt;/P&gt;
&lt;P&gt;Add additional delimiters as a string literal or variable containing desired delimiters after the search string.&lt;/P&gt;
&lt;P&gt;Note that you do want to include a blank or that would stop being a delimiter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;indexw&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;texto&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;ra, " ,.!?/()&amp;amp;%" &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 15:57:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-not-finding-string-if-there-is-a-comma-or-dot-etc-after-it/m-p/564503#M158362</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-07T15:57:48Z</dc:date>
    </item>
  </channel>
</rss>

