<?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: Remove last two words in a free text field in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Remove-last-two-words-in-a-free-text-field/m-p/455247#M14050</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
x='Hillcrest Avenue Hillcrest Auckland   ';
call scan(x, -2, position, length);
substr(x,position)=' ';
put x=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Apr 2018 15:19:35 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-04-18T15:19:35Z</dc:date>
    <item>
      <title>Remove last two words in a free text field</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Remove-last-two-words-in-a-free-text-field/m-p/455118#M14044</link>
      <description>I have addresses that I need to separate as street address. The last two words in the address field is usually the region and city. Any ideas?&lt;BR /&gt;&lt;BR /&gt;Before&lt;BR /&gt;Hillcrest Avenue Hillcrest Auckland&lt;BR /&gt;&lt;BR /&gt;After&lt;BR /&gt;Hillcrest Avenue</description>
      <pubDate>Wed, 18 Apr 2018 12:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Remove-last-two-words-in-a-free-text-field/m-p/455118#M14044</guid>
      <dc:creator>eemrun</dc:creator>
      <dc:date>2018-04-18T12:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Remove last two words in a free text field</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Remove-last-two-words-in-a-free-text-field/m-p/455130#M14046</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data _null_;
x='Hillcrest Avenue Hillcrest Auckland   ';
y=prxchange('s/\w+\s+\w+$//',1,strip(x));
put x= y=;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 12:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Remove-last-two-words-in-a-free-text-field/m-p/455130#M14046</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-04-18T12:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Remove last two words in a free text field</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Remove-last-two-words-in-a-free-text-field/m-p/455132#M14047</link>
      <description>&lt;P&gt;In practice, you might want to check that you have more than 2 words in the address, before doing this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;address = substr(address, 1, length(address) - 2 - length(scan(address, -1)) - length(scan(address, -2)));&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 12:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Remove-last-two-words-in-a-free-text-field/m-p/455132#M14047</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-18T12:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Remove last two words in a free text field</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Remove-last-two-words-in-a-free-text-field/m-p/455247#M14050</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
x='Hillcrest Avenue Hillcrest Auckland   ';
call scan(x, -2, position, length);
substr(x,position)=' ';
put x=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 15:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Remove-last-two-words-in-a-free-text-field/m-p/455247#M14050</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-04-18T15:19:35Z</dc:date>
    </item>
  </channel>
</rss>

