<?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 ELI5: FIND vs INDEX in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ELI5-FIND-vs-INDEX/m-p/844334#M333798</link>
    <description>&lt;P&gt;This is how the base explain prep guide explains INDEX and FIND.&lt;/P&gt;
&lt;P&gt;I don't know about you but to me, the author seems to rewrite the same thing but in three separate sentences for INDEX and FIND respectively.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_1-1668510007091.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77316i11DB876F2F5E366A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_1-1668510007091.png" alt="Nietzsche_1-1668510007091.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_2-1668510047894.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77317i4B869EF195CDA7B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_2-1668510047894.png" alt="Nietzsche_2-1668510047894.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both search specific string/substring from left to right, looking for first occurrence of the string/substring, if nothing is found return 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;only difference I see is&lt;/P&gt;
&lt;P&gt;INDEX&amp;nbsp; is for string while&lt;/P&gt;
&lt;P&gt;FIND is for subtring.&lt;/P&gt;
&lt;P&gt;But the book never explains what the difference is between a string and a substring in this context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;using the example in the book&lt;/P&gt;
&lt;PRE&gt;data work.datapool;
set cert.temp;
index = index(job,'word processing');
find = find(job,'word processing');
run;
proc print data=work.datapool;run;&lt;/PRE&gt;
&lt;P&gt;the result is the same&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_4-1668510694536.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77319i86F801D6B1C3E5F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_4-1668510694536.png" alt="Nietzsche_4-1668510694536.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;so I am guessing in context "word processing" is both a string and a substring if I go by the prep guide explanation of the FIND and INDEX?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2022 11:12:39 GMT</pubDate>
    <dc:creator>Nietzsche</dc:creator>
    <dc:date>2022-11-15T11:12:39Z</dc:date>
    <item>
      <title>ELI5: FIND vs INDEX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ELI5-FIND-vs-INDEX/m-p/844334#M333798</link>
      <description>&lt;P&gt;This is how the base explain prep guide explains INDEX and FIND.&lt;/P&gt;
&lt;P&gt;I don't know about you but to me, the author seems to rewrite the same thing but in three separate sentences for INDEX and FIND respectively.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_1-1668510007091.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77316i11DB876F2F5E366A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_1-1668510007091.png" alt="Nietzsche_1-1668510007091.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_2-1668510047894.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77317i4B869EF195CDA7B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_2-1668510047894.png" alt="Nietzsche_2-1668510047894.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both search specific string/substring from left to right, looking for first occurrence of the string/substring, if nothing is found return 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;only difference I see is&lt;/P&gt;
&lt;P&gt;INDEX&amp;nbsp; is for string while&lt;/P&gt;
&lt;P&gt;FIND is for subtring.&lt;/P&gt;
&lt;P&gt;But the book never explains what the difference is between a string and a substring in this context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;using the example in the book&lt;/P&gt;
&lt;PRE&gt;data work.datapool;
set cert.temp;
index = index(job,'word processing');
find = find(job,'word processing');
run;
proc print data=work.datapool;run;&lt;/PRE&gt;
&lt;P&gt;the result is the same&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_4-1668510694536.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77319i86F801D6B1C3E5F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_4-1668510694536.png" alt="Nietzsche_4-1668510694536.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;so I am guessing in context "word processing" is both a string and a substring if I go by the prep guide explanation of the FIND and INDEX?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 11:12:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ELI5-FIND-vs-INDEX/m-p/844334#M333798</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-11-15T11:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: ELI5: FIND vs INDEX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ELI5-FIND-vs-INDEX/m-p/844336#M333800</link>
      <description>&lt;P&gt;There is a lot of overlap between FIND and INDEX. In many cases, they produce the same answers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FIND has additional options not in INDEX. For some reason, the documentation you show doesn't mention these additional options. &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/p00ab6ey29t2i8n1ihel88tqtga9.htm" target="_self"&gt;Here&lt;/A&gt; is the full documentation for FIND.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 11:22:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ELI5-FIND-vs-INDEX/m-p/844336#M333800</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-15T11:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: ELI5: FIND vs INDEX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ELI5-FIND-vs-INDEX/m-p/844360#M333805</link>
      <description>&lt;P&gt;I don't think there is a difference between "string" and "substring" in this context.&amp;nbsp; I can see how it may be confusing to see these two functions presented side by side, and you're trying to figure out what the difference is, and the only difference you see is in that wording.&amp;nbsp; I think the difference in wording likely comes from the documentation, and is a result of FIND being introduced in a much later version than INDEX.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you look in the documentation for a function, there is often a section at the bottom which explains how a function differs from similar functions.&amp;nbsp; For FIND, it says:&lt;/P&gt;
&lt;PRE&gt;The FIND function and the INDEX function both search for substrings of characters in a character string. However, the INDEX function does not have the modifier nor the start-position arguments.&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Nov 2022 11:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ELI5-FIND-vs-INDEX/m-p/844360#M333805</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-11-15T11:54:28Z</dc:date>
    </item>
  </channel>
</rss>

