<?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: Need Help Understanding part of FIND command in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188786#M35660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes &lt;A __default_attr="836192" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;, I think that is the piece of information I overlooked.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;To confirm, I ran the following code:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; file log;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xyz='She sells seashells? Yes, she does.';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length letter $ 3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do pos=1 to length(xyz);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; backwards=pos-36;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; letter=substr(xyz,pos,1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result=find(xyz,'She','i',backwards);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put letter= pos= backwards= result=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which gives the following result, completely consistent with the documentation, especially now that you have pointed out the information that I was overlooking&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=S pos=1 backwards=-35 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=h pos=2 backwards=-34 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=3 backwards=-33 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=4 backwards=-32 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=5 backwards=-31 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=6 backwards=-30 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=7 backwards=-29 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=8 backwards=-28 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=9 backwards=-27 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=10 backwards=-26 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=11 backwards=-25 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=12 backwards=-24 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=a pos=13 backwards=-23 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=14 backwards=-22 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=h pos=15 backwards=-21 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=16 backwards=-20 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=17 backwards=-19 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=18 backwards=-18 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=19 backwards=-17 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=? pos=20 backwards=-16 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=21 backwards=-15 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=Y pos=22 backwards=-14 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=23 backwards=-13 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=24 backwards=-12 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=, pos=25 backwards=-11 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=26 backwards=-10 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=27 backwards=-9 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=h pos=28 backwards=-8 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=29 backwards=-7 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=30 backwards=-6 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=d pos=31 backwards=-5 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=o pos=32 backwards=-4 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=33 backwards=-3 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=34 backwards=-2 result=0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=. pos=35 backwards=-1 result=0&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Oct 2014 14:20:24 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2014-10-17T14:20:24Z</dc:date>
    <item>
      <title>Need Help Understanding part of FIND command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188780#M35654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to the documentation, the FIND command in this code returns a value of 14&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;xyz='She sells seashells? Yes, she does.';&lt;BR /&gt;startposexp=1-23;&lt;BR /&gt;whereisShe_ineg22=find(xyz,'She','i',startposexp);&lt;BR /&gt;put whereisShe_ineg22;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I'm probably missing something obvious. The value of startposexp=–22, and the documentation further states that when the startpos argument of the FIND function is less than zero, "&lt;A id="p0gasv3tjb99ran11tc8g1cjg0au"&gt;&lt;/A&gt;starts the search at position –&lt;SPAN class="xis-userSuppliedValue"&gt;start-position&lt;/SPAN&gt; and the direction of the search is to the left."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Okay, so by my count, position –22 of string xyz is the second letter "s" of seashells. If you then search TO THE LEFT (which is what the documentation says), I can't understand how the result is 14. To me, the search ought to result in an answer of 1, if you go left from the second letter "s" of seashells, and search TO THE LEFT for the word 'She" ignoring case, you find it at position 1 of xyz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But apparently, I am misunderstanding, and the answer is 14.&amp;nbsp; Can someone please explain this? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 12:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188780#M35654</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2014-10-17T12:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Understanding part of FIND command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188781#M35655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to count from left to right. The minus sign change the behaviour (it searches from right to left), but the starting point is still determined from left to right. SO in your case -22 means the : Starting from the Y (from Yes) searcha to the left therefore the answer is 14.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COnsider the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;xyz='She sells seashells? Yes, she does.';&lt;/P&gt;&lt;P&gt;startposexp=1-23;&lt;/P&gt;&lt;P&gt;whereisShe_ineg17=find(xyz,'She','i',-17);&lt;/P&gt;&lt;P&gt;whereisShe_ineg14=find(xyz,'She','i',-14);&lt;/P&gt;&lt;P&gt;put whereisShe_ineg17= whereisShe_ineg14=;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whereisShe_ineg17=14 whereisShe_ineg14=1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 13:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188781#M35655</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-10-17T13:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Understanding part of FIND command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188782#M35656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;the starting point is still determined from left to right&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;This would seem to give the correct explanation, but why then would the SAS documentation specifically point out that if startpos &amp;gt; 0 then the search "&lt;A id="p0bmqjkzpn7v3pn1mgd21he8tx5t"&gt;&lt;/A&gt;starts the search at position &lt;SPAN class="xis-userSuppliedValue"&gt;start-position" while if startpos&amp;lt;0 then the search "starts the search at position –start-position"? These are saying different things about where the search starts. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;Does this all boil down to incorrect (or confusing) documentation?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 13:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188782#M35656</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2014-10-17T13:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Understanding part of FIND command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188783#M35657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I am afraid sas documentation is right . You should count it in this way :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;She sells seashells? Yes, she doe s .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&amp;nbsp; ^&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -2 -1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so search it from left, the first letter to left is S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 13:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188783#M35657</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-10-17T13:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Understanding part of FIND command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188784#M35658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A __default_attr="645292" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;, but I just am not understanding what the FIND command is doing in this case. Your explanation hasn't helped me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see how starting from the second "s" in seashells (which I agree is at position -22), you search to the left and find "she" (ignoring case) at position 14. From that letter "s" at position -22 and going left, you don't come to the word "she" ignoring case, until you get to the very first letter of xyz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make everything crystal clear, here is the text string, counting letters forward and backward, show me how you get an answer of 14.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=S pos=1 backwards=-35&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=h pos=2 backwards=-34&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=3 backwards=-33&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=4 backwards=-32&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=5 backwards=-31&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=6 backwards=-30&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=7 backwards=-29&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=8 backwards=-28&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=9 backwards=-27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=10 backwards=-26&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=11 backwards=-25&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=12 backwards=-24&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=a pos=13 backwards=-23&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=14 backwards=-22&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=h pos=15 backwards=-21&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=16 backwards=-20&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=17 backwards=-19&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=18 backwards=-18&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=19 backwards=-17&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=? pos=20 backwards=-16&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=21 backwards=-15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=Y pos=22 backwards=-14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=23 backwards=-13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=24 backwards=-12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=, pos=25 backwards=-11&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=26 backwards=-10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=27 backwards=-9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=h pos=28 backwards=-8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=29 backwards=-7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=30 backwards=-6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=d pos=31 backwards=-5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=o pos=32 backwards=-4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=33 backwards=-3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=34 backwards=-2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=. pos=35 backwards=-1&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 14:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188784#M35658</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2014-10-17T14:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Understanding part of FIND command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188785#M35659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The documentation says:&lt;/P&gt;&lt;P&gt;&lt;A name="a002893516"&gt;&lt;/A&gt;&lt;EM&gt;If &lt;SPAN class="emph"&gt;startpos&lt;/SPAN&gt; is not specified, FIND starts the search at the beginning of the &lt;SPAN class="emph"&gt;string&lt;/SPAN&gt; and searches the &lt;SPAN class="emph"&gt;string&lt;/SPAN&gt; from left to right. If &lt;SPAN class="emph"&gt;startpos&lt;/SPAN&gt; is specified, &lt;STRONG&gt;the absolute value of &lt;SPAN class="emph"&gt;startpos&lt;/SPAN&gt; determines the position at which to start the search&lt;/STRONG&gt;. The sign of &lt;SPAN class="emph"&gt;startpos&lt;/SPAN&gt; determines the direction of the search.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore the position is always counted from left to right .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 14:13:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188785#M35659</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-10-17T14:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Understanding part of FIND command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188786#M35660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes &lt;A __default_attr="836192" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;, I think that is the piece of information I overlooked.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;To confirm, I ran the following code:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; file log;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xyz='She sells seashells? Yes, she does.';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length letter $ 3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do pos=1 to length(xyz);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; backwards=pos-36;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; letter=substr(xyz,pos,1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result=find(xyz,'She','i',backwards);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put letter= pos= backwards= result=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which gives the following result, completely consistent with the documentation, especially now that you have pointed out the information that I was overlooking&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=S pos=1 backwards=-35 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=h pos=2 backwards=-34 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=3 backwards=-33 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=4 backwards=-32 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=5 backwards=-31 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=6 backwards=-30 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=7 backwards=-29 result=27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=8 backwards=-28 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=9 backwards=-27 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=10 backwards=-26 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=11 backwards=-25 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=12 backwards=-24 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=a pos=13 backwards=-23 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=14 backwards=-22 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=h pos=15 backwards=-21 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=16 backwards=-20 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=17 backwards=-19 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=l pos=18 backwards=-18 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=19 backwards=-17 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=? pos=20 backwards=-16 result=14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=21 backwards=-15 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=Y pos=22 backwards=-14 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=23 backwards=-13 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=24 backwards=-12 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=, pos=25 backwards=-11 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=26 backwards=-10 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=27 backwards=-9 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=h pos=28 backwards=-8 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=29 backwards=-7 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=&amp;nbsp; pos=30 backwards=-6 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=d pos=31 backwards=-5 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=o pos=32 backwards=-4 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=e pos=33 backwards=-3 result=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=s pos=34 backwards=-2 result=0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;letter=. pos=35 backwards=-1 result=0&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 14:20:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188786#M35660</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2014-10-17T14:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Understanding part of FIND command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188787#M35661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I might not explain more clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;She sells sea&lt;STRONG&gt;s&lt;/STRONG&gt;hells? Yes, she doe s .&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&amp;nbsp; ^&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -2 -1&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;So search from left the first letter is S , and found she at that position. But this position you should count it from right .&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;in other words, from the right to count it until she . you will get number 14 .&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 14:28:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-Understanding-part-of-FIND-command/m-p/188787#M35661</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-10-17T14:28:58Z</dc:date>
    </item>
  </channel>
</rss>

