<?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 Only take last string from multiple strings in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670035#M36455</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I'm currently in the process of learning SAS using SAS Enterprise Guide and I was wondering if there was a way to extract the last string after a semicolon and space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example: Stephanie; Ashley; David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to be able to extract JUST David from this if possible. Please let me know if you need any additional details.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jul 2020 00:49:41 GMT</pubDate>
    <dc:creator>scha1996</dc:creator>
    <dc:date>2020-07-17T00:49:41Z</dc:date>
    <item>
      <title>Only take last string from multiple strings</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670035#M36455</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I'm currently in the process of learning SAS using SAS Enterprise Guide and I was wondering if there was a way to extract the last string after a semicolon and space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example: Stephanie; Ashley; David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to be able to extract JUST David from this if possible. Please let me know if you need any additional details.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 00:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670035#M36455</guid>
      <dc:creator>scha1996</dc:creator>
      <dc:date>2020-07-17T00:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Only take last string from multiple strings</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670037#M36456</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  string = 'Stephanie; Ashley; David';
  last_word = scan(string, countw(string));
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jul 2020 01:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670037#M36456</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-07-17T01:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Only take last string from multiple strings</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670061#M36457</link>
      <description>&lt;P&gt;The scan function has an option to let it start looking from end of the string onwards. In this case the solution provided by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt; seems to be easier to understand, but if you need the second last-word, i would use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  string = 'Stephanie; Ashley; David';
  last_word = scan(string, 2, '; ', 'b');
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jul 2020 05:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670061#M36457</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-07-17T05:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Only take last string from multiple strings</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670118#M36460</link>
      <description>&lt;P&gt;Thank you so much!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 13:24:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670118#M36460</guid>
      <dc:creator>scha1996</dc:creator>
      <dc:date>2020-07-17T13:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Only take last string from multiple strings</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670168#M36461</link>
      <description>&lt;P&gt;In fact, you don't even need the 'B' parameter for backward scanning.&amp;nbsp; Any negative number in he second parameter tells sas to scan backwards:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  string = 'Stephanie; Ashley; David';
  last_word=scan(string,-1,';');
  put (_all_) (=);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jul 2020 17:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Only-take-last-string-from-multiple-strings/m-p/670168#M36461</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-07-17T17:12:01Z</dc:date>
    </item>
  </channel>
</rss>

