<?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: like/index in proc SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71510#M20642</link>
    <description>Thank you!&lt;BR /&gt;
&lt;BR /&gt;
-- Here is the code with 1,301,674 rows and 1 colunm&lt;BR /&gt;
&lt;BR /&gt;
proc sql ;&lt;BR /&gt;
  select member_id         &lt;BR /&gt;
  from member_promotion_tbl as p&lt;BR /&gt;
  left join&lt;BR /&gt;
    member_offer_tbl as c               &lt;BR /&gt;
  on  p.offer_id=c.offer_id        &lt;BR /&gt;
  where upcase(desc) like '%SUN%';&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
-- but 0 rows and 1 colunm if "where index(upcase(desc), 'SUN')&amp;gt;0" was used.&lt;BR /&gt;
&lt;BR /&gt;
I am not sure why.</description>
    <pubDate>Sun, 12 Sep 2010 20:41:42 GMT</pubDate>
    <dc:creator>Ying</dc:creator>
    <dc:date>2010-09-12T20:41:42Z</dc:date>
    <item>
      <title>like/index in proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71508#M20640</link>
      <description>When pull all the records that contain "SUN" string,  &lt;BR /&gt;
I normally use INDEX(UPCASE(desc), 'SUN') &amp;gt;0 on Proc SQL, but this time, it would NOT work and I have to use UPCASE(desc) LIKE '%SUN%' on Proc SQL to make it work.  I just want to know why?  Could someone tell me?  &lt;BR /&gt;
&lt;BR /&gt;
Thank you! Ying</description>
      <pubDate>Sun, 12 Sep 2010 19:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71508#M20640</guid>
      <dc:creator>Ying</dc:creator>
      <dc:date>2010-09-12T19:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: like/index in proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71509#M20641</link>
      <description>Ying,&lt;BR /&gt;
&lt;BR /&gt;
Can you provide the forum with an example data step that produces a file where the two proc sqls differ, as well as the full two proc sql calls?&lt;BR /&gt;
&lt;BR /&gt;
Art</description>
      <pubDate>Sun, 12 Sep 2010 20:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71509#M20641</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-09-12T20:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: like/index in proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71510#M20642</link>
      <description>Thank you!&lt;BR /&gt;
&lt;BR /&gt;
-- Here is the code with 1,301,674 rows and 1 colunm&lt;BR /&gt;
&lt;BR /&gt;
proc sql ;&lt;BR /&gt;
  select member_id         &lt;BR /&gt;
  from member_promotion_tbl as p&lt;BR /&gt;
  left join&lt;BR /&gt;
    member_offer_tbl as c               &lt;BR /&gt;
  on  p.offer_id=c.offer_id        &lt;BR /&gt;
  where upcase(desc) like '%SUN%';&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
-- but 0 rows and 1 colunm if "where index(upcase(desc), 'SUN')&amp;gt;0" was used.&lt;BR /&gt;
&lt;BR /&gt;
I am not sure why.</description>
      <pubDate>Sun, 12 Sep 2010 20:41:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71510#M20642</guid>
      <dc:creator>Ying</dc:creator>
      <dc:date>2010-09-12T20:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: like/index in proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71511#M20643</link>
      <description>Almost!  Can you provide samples of the two files, in the form of a data step, but with only about 10 records each?&lt;BR /&gt;
&lt;BR /&gt;
Specifically, though, an example where the one code works, but the other doesn't work.&lt;BR /&gt;
&lt;BR /&gt;
Art</description>
      <pubDate>Sun, 12 Sep 2010 22:20:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71511#M20643</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-09-12T22:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: like/index in proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71512#M20644</link>
      <description>I think the preblom you meet is because the 'desc' is the SAS's key-word,that means sas has special usage for 'desc' ,you will notice that  the color of 'desc' would be blue when you input it. You can try to rename 'desc'.&lt;BR /&gt;
 The code below would have the correct result.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 select * &lt;BR /&gt;
  from sashelp.class&lt;BR /&gt;
   where index(upcase(name),'NE')&amp;gt;0;&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 17 Sep 2010 08:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71512#M20644</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-09-17T08:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: like/index in proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71513#M20645</link>
      <description>Suggest you post-reply with a SAS log output revealing all SAS code executed and two code-executions where you are not getting output that you expected.  Based on personal experience, simply showing SAS statements doesn't provide enough actual evidence.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/a002536894.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/a002536894.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 17 Sep 2010 13:52:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71513#M20645</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-17T13:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: like/index in proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71514#M20646</link>
      <description>but I tested both works;&lt;BR /&gt;
data test;&lt;BR /&gt;
desc='absunc';&lt;BR /&gt;
output;&lt;BR /&gt;
desc='abced';output;&lt;BR /&gt;
desc='sunac';output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
select * from test where upcase(desc) like '%SUN%';&lt;BR /&gt;
select * from test where index(upcase(desc),'SUN')&amp;gt;0;&lt;BR /&gt;
quit;</description>
      <pubDate>Fri, 17 Sep 2010 16:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71514#M20646</guid>
      <dc:creator>SUN59338</dc:creator>
      <dc:date>2010-09-17T16:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: like/index in proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71515#M20647</link>
      <description>SBB .&lt;BR /&gt;
You are right. I actually not test author's code,Just keep my mind free.&lt;BR /&gt;
Although the author has meet the problem ,I test my code correctly, and it can work.&lt;BR /&gt;
Maybe there are some other factor to make author wrong.I am not quit sure.:-)</description>
      <pubDate>Mon, 20 Sep 2010 06:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/like-index-in-proc-SQL/m-p/71515#M20647</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-09-20T06:25:31Z</dc:date>
    </item>
  </channel>
</rss>

