<?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: FIND Function FIND() not giving expected result in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784485#M250360</link>
    <description>&lt;P&gt;Compare the lengths of the compressed strings. If they are the same, compare their value printed with the $hex. format.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Dec 2021 07:52:15 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2021-12-07T07:52:15Z</dc:date>
    <item>
      <title>FIND Function FIND() not giving expected result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784482#M250357</link>
      <description>&lt;P&gt;Find function is giving unexpected results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vkabdwal_0-1638862336987.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66451i02F6849B08B337E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vkabdwal_0-1638862336987.png" alt="vkabdwal_0-1638862336987.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am expecting 1 as the answer here but getting 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In text format output for last three fields:&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;full_rating:&amp;nbsp; "Action: New Rating (Mar-07-2018)&lt;BR /&gt;From ""-"" to ""BB-"""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;b_rating:&amp;nbsp; &amp;nbsp;"Action: New Rating (Mar-07-2018)&lt;BR /&gt;From ""-"" to ""BB-"""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;find:&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
create table old_match_change as

select *, find(compress(upcase(full_rating),' ():"'), compress(upcase(b_rating),' ():"')) as find
from old_match 
where find(compress(upcase(full_rating),' ():"'), compress(upcase(b_rating),' ():"'))=0;
quit;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Dec 2021 07:35:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784482#M250357</guid>
      <dc:creator>vkabdwal</dc:creator>
      <dc:date>2021-12-07T07:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: FIND Function FIND() not giving expected result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784483#M250358</link>
      <description>&lt;P&gt;You seem to have a line break. Compress non-printable characters too a lines breaks can take different forms.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 07:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784483#M250358</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-12-07T07:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: FIND Function FIND() not giving expected result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784484#M250359</link>
      <description>What solution you suggest? Please elaborate a bit.</description>
      <pubDate>Tue, 07 Dec 2021 07:48:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784484#M250359</guid>
      <dc:creator>vkabdwal</dc:creator>
      <dc:date>2021-12-07T07:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: FIND Function FIND() not giving expected result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784485#M250360</link>
      <description>&lt;P&gt;Compare the lengths of the compressed strings. If they are the same, compare their value printed with the $hex. format.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 07:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784485#M250360</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-12-07T07:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: FIND Function FIND() not giving expected result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784486#M250361</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;compress&lt;/STRONG&gt; function allows you to eliminate non-printable characters. See the documentation.&lt;/P&gt;
&lt;P&gt;Note also that the &lt;STRONG&gt;find&lt;/STRONG&gt; function allows case insensitive comparisons, so you needn't use the &lt;STRONG&gt;upcase&lt;/STRONG&gt; function here. Again see the documentation.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 07:54:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784486#M250361</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-12-07T07:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: FIND Function FIND() not giving expected result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784491#M250363</link>
      <description>&lt;P&gt;If you want to get rid of the line breaks, use 'c' (remove control characters) as the third parameter to COMPRESS, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table old_match_change as

select *, find(compress(upcase(full_rating),' ():"','c'), compress(upcase(b_rating),' ():"','c')) as find
from old_match 
where find(compress(upcase(full_rating),' ():"','c'), compress(upcase(b_rating),' ():"','c'))=0;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Dec 2021 09:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784491#M250363</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2021-12-07T09:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: FIND Function FIND() not giving expected result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784493#M250364</link>
      <description>&lt;P&gt;Did the trick. Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76464"&gt;@s_lassen&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;for you valuable inputs.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 09:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-Function-FIND-not-giving-expected-result/m-p/784493#M250364</guid>
      <dc:creator>vkabdwal</dc:creator>
      <dc:date>2021-12-07T09:31:19Z</dc:date>
    </item>
  </channel>
</rss>

