<?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 Remove digit and string after digit in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-digit-and-string-after-digit/m-p/724421#M224905</link>
    <description>&lt;P&gt;I have some dataset like this:&lt;/P&gt;&lt;P&gt;KAWASAN PERINDTRIAN MASJID TANAH,78300 MASJID TANAH, MELAKA,MALAYSIA&lt;/P&gt;&lt;P&gt;MUKIM SERKAM 77300 MERLIMAU, MELAKA&lt;/P&gt;&lt;P&gt;PAYA MENGKUANG 78300 MASJID TANAH MELAKA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to remove the 5 digit postcode and string after postcode.&lt;/P&gt;&lt;P&gt;The output that I want is like this:&lt;/P&gt;&lt;P&gt;KAWASAN PERINDTRIAN MASJID TANAH&lt;/P&gt;&lt;P&gt;MUKIM SERKAM&lt;/P&gt;&lt;P&gt;PAYA MENGKUANG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Mar 2021 08:23:47 GMT</pubDate>
    <dc:creator>syazwaan</dc:creator>
    <dc:date>2021-03-08T08:23:47Z</dc:date>
    <item>
      <title>Remove digit and string after digit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-digit-and-string-after-digit/m-p/724421#M224905</link>
      <description>&lt;P&gt;I have some dataset like this:&lt;/P&gt;&lt;P&gt;KAWASAN PERINDTRIAN MASJID TANAH,78300 MASJID TANAH, MELAKA,MALAYSIA&lt;/P&gt;&lt;P&gt;MUKIM SERKAM 77300 MERLIMAU, MELAKA&lt;/P&gt;&lt;P&gt;PAYA MENGKUANG 78300 MASJID TANAH MELAKA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to remove the 5 digit postcode and string after postcode.&lt;/P&gt;&lt;P&gt;The output that I want is like this:&lt;/P&gt;&lt;P&gt;KAWASAN PERINDTRIAN MASJID TANAH&lt;/P&gt;&lt;P&gt;MUKIM SERKAM&lt;/P&gt;&lt;P&gt;PAYA MENGKUANG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 08:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-digit-and-string-after-digit/m-p/724421#M224905</guid>
      <dc:creator>syazwaan</dc:creator>
      <dc:date>2021-03-08T08:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Remove digit and string after digit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-digit-and-string-after-digit/m-p/724427#M224911</link>
      <description>&lt;P&gt;Is it 100% that only one five-digit-number is in the data? If yes, then try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   length new $ 100;

   new = prxchange('s/(.*)\W+\d{5}.*/$1/', 1, string);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Mar 2021 08:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-digit-and-string-after-digit/m-p/724427#M224911</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-03-08T08:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Remove digit and string after digit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-digit-and-string-after-digit/m-p/724433#M224915</link>
      <description>&lt;P&gt;Alternative code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvar = substr(string,1,indexc(string,'0123456789')-1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This code searches for the first digit in string, even if it is not a postcode of 5 digits.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 08:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-digit-and-string-after-digit/m-p/724433#M224915</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-03-08T08:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Remove digit and string after digit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-digit-and-string-after-digit/m-p/724454#M224927</link>
      <description>&lt;PRE&gt;data have;
input x $80.;
cards;
KAWASAN PERINDTRIAN MASJID TANAH,78300 MASJID TANAH, MELAKA,MALAYSIA
MUKIM SERKAM 77300 MERLIMAU, MELAKA
PAYA MENGKUANG 78300 MASJID TANAH MELAKA
;
data want;
 set have;
 want=substr(x,1,prxmatch('/\d{5}/',x)-1);
 run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Mar 2021 11:05:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-digit-and-string-after-digit/m-p/724454#M224927</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-03-08T11:05:05Z</dc:date>
    </item>
  </channel>
</rss>

