<?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 Case Sensitivity with &amp;quot;Like&amp;quot; in Proc SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Case-Sensitivity-with-quot-Like-quot-in-Proc-SQL/m-p/17987#M3487</link>
    <description>I ran into a situation where I wasn't getting the expected reults in a Proc SQL query.  The line on my select statement was: "sum(case when table.name LIKE '%stove%' then 1 else 0 end) as TotalCount.  I wasn't getting the correct results and discovered that the LIKE function is case-sensitive, causing the problem.  However, I also discovered if I change the above line to "count(*) as TotalCount" and then use the like statement in the left join line: "LEFT JOIN table on table.id = root.id and table.name LIKE '%stove%' ", it isn't case-sensitive.&lt;BR /&gt;
&lt;BR /&gt;
1st question, is there a way to make the LIKE function case-insenstive all the time?  2nd question, does anyone know why it would be case-sensitive in certain situations and not in others?</description>
    <pubDate>Fri, 07 May 2010 19:22:15 GMT</pubDate>
    <dc:creator>jlcalbre</dc:creator>
    <dc:date>2010-05-07T19:22:15Z</dc:date>
    <item>
      <title>Case Sensitivity with "Like" in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Case-Sensitivity-with-quot-Like-quot-in-Proc-SQL/m-p/17987#M3487</link>
      <description>I ran into a situation where I wasn't getting the expected reults in a Proc SQL query.  The line on my select statement was: "sum(case when table.name LIKE '%stove%' then 1 else 0 end) as TotalCount.  I wasn't getting the correct results and discovered that the LIKE function is case-sensitive, causing the problem.  However, I also discovered if I change the above line to "count(*) as TotalCount" and then use the like statement in the left join line: "LEFT JOIN table on table.id = root.id and table.name LIKE '%stove%' ", it isn't case-sensitive.&lt;BR /&gt;
&lt;BR /&gt;
1st question, is there a way to make the LIKE function case-insenstive all the time?  2nd question, does anyone know why it would be case-sensitive in certain situations and not in others?</description>
      <pubDate>Fri, 07 May 2010 19:22:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Case-Sensitivity-with-quot-Like-quot-in-Proc-SQL/m-p/17987#M3487</guid>
      <dc:creator>jlcalbre</dc:creator>
      <dc:date>2010-05-07T19:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Case Sensitivity with "Like" in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Case-Sensitivity-with-quot-Like-quot-in-Proc-SQL/m-p/17988#M3488</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Using the following statement will probably fit with your needs:&lt;BR /&gt;
&lt;BR /&gt;
sum(case when upcase(table.name) LIKE '%STOVE%' then 1 else 0 end) as TotalCount&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Florent</description>
      <pubDate>Mon, 10 May 2010 13:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Case-Sensitivity-with-quot-Like-quot-in-Proc-SQL/m-p/17988#M3488</guid>
      <dc:creator>Florent</dc:creator>
      <dc:date>2010-05-10T13:00:50Z</dc:date>
    </item>
  </channel>
</rss>

