<?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 How to replace all but last occurences of a substring in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-all-but-last-occurences-of-a-substring/m-p/765044#M242298</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;How can I replace all dots, except for the last one in the string? I want something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds;
input have :$15. want :$15.;
datalines;
abc.def.ghi abcdef.ghi
xyz.zyx xyz.zyx
1.234.567.8 1234567.8
134.56 134.54
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I know how to replace all dots, but I don't how to leave the last one&lt;/P&gt;</description>
    <pubDate>Tue, 31 Aug 2021 12:55:45 GMT</pubDate>
    <dc:creator>chris2377</dc:creator>
    <dc:date>2021-08-31T12:55:45Z</dc:date>
    <item>
      <title>How to replace all but last occurences of a substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-all-but-last-occurences-of-a-substring/m-p/765044#M242298</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;How can I replace all dots, except for the last one in the string? I want something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds;
input have :$15. want :$15.;
datalines;
abc.def.ghi abcdef.ghi
xyz.zyx xyz.zyx
1.234.567.8 1234567.8
134.56 134.54
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I know how to replace all dots, but I don't how to leave the last one&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 12:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-all-but-last-occurences-of-a-substring/m-p/765044#M242298</guid>
      <dc:creator>chris2377</dc:creator>
      <dc:date>2021-08-31T12:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace all but last occurences of a substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-all-but-last-occurences-of-a-substring/m-p/765046#M242299</link>
      <description>&lt;P&gt;How about this one ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds;
input have :$15. want :$15.;
datalines;
abc.def.ghi abcdef.ghi
xyz.zyx xyz.zyx
1.234.567.8 1234567.8
134.56 134.54
;
run;
data want;
 set ds;
 n=countc(have,'.')-1;
 new_want=prxchange('s/\.//',n,have);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 13:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-all-but-last-occurences-of-a-substring/m-p/765046#M242299</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-08-31T13:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace all but last occurences of a substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-all-but-last-occurences-of-a-substring/m-p/765051#M242301</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&lt;BR /&gt;Perfect. Thanks!</description>
      <pubDate>Tue, 31 Aug 2021 13:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-all-but-last-occurences-of-a-substring/m-p/765051#M242301</guid>
      <dc:creator>chris2377</dc:creator>
      <dc:date>2021-08-31T13:08:07Z</dc:date>
    </item>
  </channel>
</rss>

