<?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 Which function is the best to locate that data: scan, index, or indexc? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/527667#M143909</link>
    <description>&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;When looking for data contained in a character string of 150 bytes, which function is the best to locate that data: scan, index, or indexc?&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jan 2019 09:34:34 GMT</pubDate>
    <dc:creator>sandeep12</dc:creator>
    <dc:date>2019-01-16T09:34:34Z</dc:date>
    <item>
      <title>Which function is the best to locate that data: scan, index, or indexc?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/527667#M143909</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;When looking for data contained in a character string of 150 bytes, which function is the best to locate that data: scan, index, or indexc?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 09:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/527667#M143909</guid>
      <dc:creator>sandeep12</dc:creator>
      <dc:date>2019-01-16T09:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Which function is the best to locate that data: scan, index, or indexc?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/527670#M143910</link>
      <description>&lt;P&gt;Depends largely on what you actually want to do. Consult the SAS Documentation for the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n0vxokxhv8lr84n10nrbnzp7gnba.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;Index&lt;/A&gt;, &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n04ha26lk1sr1in1043awq6wav80.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;Indexc&lt;/A&gt; and &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0jshdjy2z9zdzn1h7k90u99lyq6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;Scan&lt;/A&gt; functions to see what fits your needs best.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or be more specific about your actual problem. Post some example data and what your desired result looks like. Then we can give you a usable code answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, welcome to the SAS communities &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 09:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/527670#M143910</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-16T09:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Which function is the best to locate that data: scan, index, or indexc?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/527671#M143911</link>
      <description>&lt;P&gt;The data you have and the end result you expect will define which tools to use when going from here to there.&lt;/P&gt;
&lt;P&gt;So you need to show us your data, and what you want to extract or find.&lt;/P&gt;
&lt;P&gt;Hints for posting existing data in a usable form can be found in my footnotes. The preferred way for posting data is a data step with datalines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should refrain from using the bold typeface for your whole post. Use bold only to emphasize certain parts; by using bold all the way through you lose that option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And make it a habit to answer to posts given in response to your questions (&lt;A href="https://communities.sas.com/t5/SAS-Programming/Difference-between-reading-data-from-an-external-file-and/m-p/526015" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Difference-between-reading-data-from-an-external-file-and/m-p/526015&lt;/A&gt;), so we can know if our answers were helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 10:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/527671#M143911</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-16T10:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Which function is the best to locate that data: scan, index, or indexc?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/527988#M144037</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Index function&lt;/STRONG&gt;&amp;nbsp;–&amp;nbsp;Searches a character expression for a&lt;A title="string of characters " href="https://data-flair.training/blogs/sas-string-functions/" target="_self"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;A title="string of characters " href="https://data-flair.training/blogs/sas-string-functions/" target="_self"&gt;string of characters&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;SAS Statements&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Results&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a=’ABC.DEF (X=Y)’;&lt;BR /&gt;b=’X=Y’;&lt;BR /&gt;x=index(a,b);&lt;BR /&gt;put x;&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 17 Jan 2019 10:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/527988#M144037</guid>
      <dc:creator>rinugour</dc:creator>
      <dc:date>2019-01-17T10:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Which function is the best to locate that data: scan, index, or indexc?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/528385#M144210</link>
      <description>&lt;P&gt;Don't forget INDEXW,&amp;nbsp;FIND, FINDC&amp;nbsp;and FINDW as well.&lt;/P&gt;
&lt;P&gt;Also if your text is double-byte characters you would be looking at Kindex or other K function equivalents.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SCAN implies that you are providing a "word" position so would likely require a loop of some sort to find a specific word. If the string you want to find includes the delimiter that Scan is using then this function is likely not for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the string you are searching for may be part of another word and you only want complete "words" then Index and Indexc are probably not what you want though Indexw might. If the entire string value you search for must be there then you do not want Indexc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to find the first position of &lt;STRONG&gt;any&lt;/STRONG&gt; of a list of characters then INDEXC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need or want to specify a start position then you likely want one of the FIND functions, or to search backwards from the end of a string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actual examples of what you want to search in, search for what to return, position or word number, will likely determine what is "best" or even may work at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the length of the character string really doesn't matter though searching for a 6 character word in variable of length 5 is contraindicated.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 17:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Which-function-is-the-best-to-locate-that-data-scan-index-or/m-p/528385#M144210</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-18T17:18:59Z</dc:date>
    </item>
  </channel>
</rss>

