<?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: substr with nesting find in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/substr-with-nesting-find/m-p/324786#M72125</link>
    <description>&lt;P&gt;Have you tried the&amp;nbsp;&lt;EM&gt;reverse&lt;/EM&gt; function? It's easier if you set up a reversed value of your&amp;nbsp;&lt;EM&gt;nam&lt;/EM&gt;&lt;EM&gt;e&lt;/EM&gt; variable. Like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data _null_;
name = "Valerie Adams";
reverse_name = reverse(name);
substring = substr(reverse_name, find(reverse_name, reverse("erie"), 'i'), 7);
put substring=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This looks for the substring&amp;nbsp;&lt;EM&gt;eire&lt;/EM&gt; (&lt;EM&gt;erie&lt;/EM&gt;, reveresed) in the reversed string, then counts back 7 characters from that point - giving&amp;nbsp;&lt;EM&gt;&lt;SPAN&gt;eirelaV&lt;/SPAN&gt;&lt;/EM&gt;. Then you can reverse that to give the answer you want.&lt;/P&gt;</description>
    <pubDate>Sat, 14 Jan 2017 03:08:39 GMT</pubDate>
    <dc:creator>LaurieF</dc:creator>
    <dc:date>2017-01-14T03:08:39Z</dc:date>
    <item>
      <title>substr with nesting find</title>
      <link>https://communities.sas.com/t5/SAS-Programming/substr-with-nesting-find/m-p/324782#M72123</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I would like to subtra a string of characters ,as I have used find function to make position.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;like substr(name,find(name,'in','i'),20), &amp;nbsp;since i want to substr from right to left.(start from the position that find function have made),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;i have no idea about how to do that with the nesting find).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2017 02:49:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/substr-with-nesting-find/m-p/324782#M72123</guid>
      <dc:creator>JNWong</dc:creator>
      <dc:date>2017-01-14T02:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: substr with nesting find</title>
      <link>https://communities.sas.com/t5/SAS-Programming/substr-with-nesting-find/m-p/324786#M72125</link>
      <description>&lt;P&gt;Have you tried the&amp;nbsp;&lt;EM&gt;reverse&lt;/EM&gt; function? It's easier if you set up a reversed value of your&amp;nbsp;&lt;EM&gt;nam&lt;/EM&gt;&lt;EM&gt;e&lt;/EM&gt; variable. Like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data _null_;
name = "Valerie Adams";
reverse_name = reverse(name);
substring = substr(reverse_name, find(reverse_name, reverse("erie"), 'i'), 7);
put substring=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This looks for the substring&amp;nbsp;&lt;EM&gt;eire&lt;/EM&gt; (&lt;EM&gt;erie&lt;/EM&gt;, reveresed) in the reversed string, then counts back 7 characters from that point - giving&amp;nbsp;&lt;EM&gt;&lt;SPAN&gt;eirelaV&lt;/SPAN&gt;&lt;/EM&gt;. Then you can reverse that to give the answer you want.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2017 03:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/substr-with-nesting-find/m-p/324786#M72125</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-01-14T03:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: substr with nesting find</title>
      <link>https://communities.sas.com/t5/SAS-Programming/substr-with-nesting-find/m-p/324787#M72126</link>
      <description>&lt;P&gt;Good Idea! I have solved my problem.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2017 03:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/substr-with-nesting-find/m-p/324787#M72126</guid>
      <dc:creator>JNWong</dc:creator>
      <dc:date>2017-01-14T03:29:29Z</dc:date>
    </item>
  </channel>
</rss>

