<?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 Index() function pick up unnecessary records in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Index-function-pick-up-unnecessary-records/m-p/411240#M100530</link>
    <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I have a quick question. When I run the&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if index(project,"VI SP - OH")&amp;gt;0 then output;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS pick up also record such as "014 VI SP" which clearly have no "- OH" component.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you fix my code so it strictly pick only those&amp;nbsp;containing "VI SP - OH" ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Nov 2017 16:23:10 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2017-11-07T16:23:10Z</dc:date>
    <item>
      <title>Index() function pick up unnecessary records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-pick-up-unnecessary-records/m-p/411240#M100530</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I have a quick question. When I run the&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if index(project,"VI SP - OH")&amp;gt;0 then output;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS pick up also record such as "014 VI SP" which clearly have no "- OH" component.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you fix my code so it strictly pick only those&amp;nbsp;containing "VI SP - OH" ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 16:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-pick-up-unnecessary-records/m-p/411240#M100530</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-11-07T16:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Index() function pick up unnecessary records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-pick-up-unnecessary-records/m-p/411242#M100532</link>
      <description>&lt;P&gt;The INDEX function works correctly.&amp;nbsp; Double check your data and the rest of the logic in your program.&amp;nbsp; Are you outputting other records by using another OUTPUT statement?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 16:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-pick-up-unnecessary-records/m-p/411242#M100532</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-11-07T16:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Index() function pick up unnecessary records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-pick-up-unnecessary-records/m-p/411244#M100533</link>
      <description>&lt;P&gt;Something else is your issue.&lt;/P&gt;
&lt;P&gt;The INDEX function will not match strings that are not exactly the same.&lt;/P&gt;
&lt;PRE&gt;574   data test;
575    input project $70. ;
576    found=index(project,"VI SP - OH");
577    put found= project=$quote. ;
578   cards;

found=0 project="014 VI SP which clearly have no ""- OH"" component."
found=5 project="015 VI SP - OH"
NOTE: The data set WORK.TEST has 2 observations and 2 variables.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 16:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-pick-up-unnecessary-records/m-p/411244#M100533</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-11-07T16:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Index() function pick up unnecessary records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-pick-up-unnecessary-records/m-p/411263#M100537</link>
      <description>&lt;P&gt;My bad. I am sorry.&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 17:13:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-pick-up-unnecessary-records/m-p/411263#M100537</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-11-07T17:13:26Z</dc:date>
    </item>
  </channel>
</rss>

