<?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: Peculiar behaviour of find()? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Peculiar-behaviour-of-find/m-p/391738#M25277</link>
    <description>&lt;P&gt;Thankyou So Much.&lt;/P&gt;&lt;P&gt;It got it and the code worked.&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Aug 2017 06:06:15 GMT</pubDate>
    <dc:creator>DipeshGupta</dc:creator>
    <dc:date>2017-08-30T06:06:15Z</dc:date>
    <item>
      <title>Peculiar behaviour of find()?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Peculiar-behaviour-of-find/m-p/391423#M25270</link>
      <description>&lt;P&gt;Data Test3 ;&lt;BR /&gt;Set Test2 ;&lt;BR /&gt;Format o_String $2000. ;&lt;BR /&gt;if _N_ = 1 then do;&lt;BR /&gt;O_String = "" ;&lt;BR /&gt;end ;&lt;BR /&gt;O_String = catx(" , ", O_String, " ") ;&lt;BR /&gt;find = Find(O_String,O_Level) ;&lt;BR /&gt;O_String = catx(" , ", O_String, O_Level) ;&lt;BR /&gt;new = Find(O_String,O_Level) ;&lt;BR /&gt;Retain O_String ;&lt;BR /&gt;Run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am confused as why the column named find is always showing zero when the column named new is showing the correct value.&lt;/P&gt;
&lt;P&gt;As per my understanding only the first row in find should show &amp;nbsp;a blank value otherwise it should also give some value but it is always giving a straight zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help me with this..??&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 13:33:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Peculiar-behaviour-of-find/m-p/391423#M25270</guid>
      <dc:creator>DipeshGupta</dc:creator>
      <dc:date>2017-08-29T13:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Peculiar behaviour of find()?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Peculiar-behaviour-of-find/m-p/391470#M25271</link>
      <description>&lt;P&gt;When assigning find, you are testing for the presence of o_level before you append it to o_string, so find will be zero unless the same value for o_level was already on the dataset.&lt;/P&gt;
&lt;P&gt;But you also made the mistake of assuming that a shorter string will consist of less characters for SAS, which it doesn't. The find() function will take the padding of o_level with blanks into account, and only find a position if the visible value of o_level can be found &lt;U&gt;&lt;EM&gt;padded with blanks&lt;/EM&gt;&lt;/U&gt; in o_string:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test2;
input o_level $;
cards;
xxx
yyy
zzz
xxx
;
run;

data test3;
set test2;
format o_string $2000.;
retain o_string "";
o_string = catx(" , ",o_string," ");
find = find(o_string,trim(o_level));
o_string = catx(" , ",o_string,o_level);
new = find(o_string,o_level);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So I used the trim() function in the first test.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 13:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Peculiar-behaviour-of-find/m-p/391470#M25271</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-29T13:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Peculiar behaviour of find()?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Peculiar-behaviour-of-find/m-p/391471#M25272</link>
      <description>&lt;P&gt;I also edited your subject line. "SAS Datastep" is very uninformative with respect to your question.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 13:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Peculiar-behaviour-of-find/m-p/391471#M25272</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-29T13:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Peculiar behaviour of find()?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Peculiar-behaviour-of-find/m-p/391738#M25277</link>
      <description>&lt;P&gt;Thankyou So Much.&lt;/P&gt;&lt;P&gt;It got it and the code worked.&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 06:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Peculiar-behaviour-of-find/m-p/391738#M25277</guid>
      <dc:creator>DipeshGupta</dc:creator>
      <dc:date>2017-08-30T06:06:15Z</dc:date>
    </item>
  </channel>
</rss>

