<?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: Get the String from the Right in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666356#M199358</link>
    <description>&lt;P&gt;Follow-up at &lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-read-delimiter-if-it-s-a-multiple-spaces/m-p/666348" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/How-to-read-delimiter-if-it-s-a-multiple-spaces/m-p/666348&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if i should merge the two messages.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 12:44:38 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-07-01T12:44:38Z</dc:date>
    <item>
      <title>Get the String from the Right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666172#M199274</link>
      <description>&lt;P&gt;I have a column with this type of structure:&lt;/P&gt;&lt;P&gt;Last_Name, First_Name Middle_Name 123456789 Company NameX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know what function should I use to get the value Company NameX? Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 18:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666172#M199274</guid>
      <dc:creator>iSAS</dc:creator>
      <dc:date>2020-06-30T18:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get the String from the Right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666175#M199275</link>
      <description>&lt;P&gt;please try below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input text&amp;amp;$100.;
cards;
Last_Name, First_Name Middle_Name 123456789 Company NameX
;

data want;
set have;
want=prxchange('s/(.*\d+\s)(\w+)/$2/oi',-1,strip(text));

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 18:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666175#M199275</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-06-30T18:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Get the String from the Right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666176#M199276</link>
      <description>&lt;P&gt;alternatively with substr&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
want=substr(text,index(text,scan(text,5,'')));

run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 18:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666176#M199276</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-06-30T18:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get the String from the Right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666178#M199277</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;namex=scan(text,-1);&lt;BR /&gt;  &lt;BR /&gt;company=scan(text,-2);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Jul 2020 01:40:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666178#M199277</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2020-07-01T01:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get the String from the Right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666261#M199312</link>
      <description>&lt;P&gt;To get any value after the last digit:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WANT;
  STR1='Last_Name, First_Name Middle_Name 123456789 Company NameX';
  STR2=prxchange('s/.*\d //',1,strip(STR1));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 04:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666261#M199312</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-01T04:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get the String from the Right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666262#M199313</link>
      <description>&lt;P&gt;The&amp;nbsp;scan() function - &lt;A href="https://go.documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0jshdjy2z9zdzn1h7k90u99lyq6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;SCAN(string, count &amp;lt;, character-list &amp;lt;, modifier&amp;gt;&amp;gt;)&lt;/A&gt; - with a negative number for the count parameter allows to search a string from the right to the left. A -1 will return the last term (=the first term from the right).&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 04:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666262#M199313</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-07-01T04:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get the String from the Right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666345#M199349</link>
      <description>Thank you for taking your time to help Patrick. Appreciate it!&lt;BR /&gt;&lt;BR /&gt;I used the scan function but i'm having issue with the delimiter. The delimiter of my data is "3 spaces". Exaample below:&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;input text&amp;amp;$100.;&lt;BR /&gt;cards;&lt;BR /&gt;Last_Name, First_Name Middle_Name 123456789 Company NameX;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;want=scan(text,1,' ');&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;My initial plan was to use COMPBL function to remove multiple spaces and have the single space as a delimiter. However, my issue on that was Full Name and Company Names may have spaces and cannot be separated. May I know the turnaround for this?</description>
      <pubDate>Wed, 01 Jul 2020 12:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666345#M199349</guid>
      <dc:creator>iSAS</dc:creator>
      <dc:date>2020-07-01T12:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get the String from the Right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666356#M199358</link>
      <description>&lt;P&gt;Follow-up at &lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-read-delimiter-if-it-s-a-multiple-spaces/m-p/666348" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/How-to-read-delimiter-if-it-s-a-multiple-spaces/m-p/666348&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if i should merge the two messages.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 12:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-String-from-the-Right/m-p/666356#M199358</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-07-01T12:44:38Z</dc:date>
    </item>
  </channel>
</rss>

