<?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: Nth Occurance  as word in a string without regex in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898094#M354974</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Kurt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I want to find 2nd occurrence position ' is'&amp;nbsp; in that text&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just reposting what you&amp;nbsp; already said won't help. Answer my questions.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Oct 2023 10:05:11 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-10-11T10:05:11Z</dc:date>
    <item>
      <title>Nth Occurance  as word in a string without regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898062#M354955</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;
&lt;P&gt;Good Moring&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nth_occurance;
c='who is this'  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the above string how to find&amp;nbsp; 'is'&amp;nbsp; &amp;nbsp; &amp;nbsp; 2nd occurrence position with out using any regex&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 07:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898062#M354955</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-10-11T07:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Nth Occurance  as word in a string without regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898066#M354957</link>
      <description>&lt;P&gt;Beats me why you do not want to use REGEX. But here is a solution using the FIND function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set nth_occurance;
  pos=-1; /* 1-length(search string) */
  do _N_=1 to 2; /* N=2, here */
    pos=find(c,'is',pos+2); /* add length(search string) to starting position */
    if pos=0 then leave;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The program returns a POS value of 0 if the nth occurrence is not in string.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 07:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898066#M354957</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2023-10-11T07:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Nth Occurance  as word in a string without regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898068#M354959</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;find()&lt;/FONT&gt; function can accept an argument for the starting position for the search, so you can search for the first occurrence and then look for the 2nd occurrence after that. See code below for an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nth_occurance;
  c = 'who is this';
  pos = find(c,'is',find(c,'is') + 1);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 07:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898068#M354959</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2023-10-11T07:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Nth Occurance  as word in a string without regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898070#M354960</link>
      <description>&lt;P&gt;Use the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p16rdsa30vmm43n1ej4936nwa01t.htm" target="_blank" rel="noopener"&gt;FINDW Function&lt;/A&gt;&amp;nbsp;with the proper modifier.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 07:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898070#M354960</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-11T07:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Nth Occurance  as word in a string without regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898074#M354963</link>
      <description>&lt;P&gt;BTW your question is very unclear. What do you want to find?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the 2nd word?&lt;/LI&gt;
&lt;LI&gt;the number/position of the word "is", if contained?&lt;/LI&gt;
&lt;LI&gt;the 2nd appearance of the word "is"?&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 11 Oct 2023 07:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898074#M354963</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-11T07:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Nth Occurance  as word in a string without regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898089#M354971</link>
      <description>&lt;P&gt;Hi Kurt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I want to find 2nd occurrence position ' is'&amp;nbsp; in that text&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 09:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898089#M354971</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-10-11T09:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Nth Occurance  as word in a string without regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898094#M354974</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Kurt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I want to find 2nd occurrence position ' is'&amp;nbsp; in that text&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just reposting what you&amp;nbsp; already said won't help. Answer my questions.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 10:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Nth-Occurance-as-word-in-a-string-without-regex/m-p/898094#M354974</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-11T10:05:11Z</dc:date>
    </item>
  </channel>
</rss>

