<?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: Replace strings using prxchange in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Replace-strings-using-prxchange/m-p/94481#M26732</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may also use "i" option to make search case insensitive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;length original_credit_provider $32;&lt;/P&gt;&lt;P&gt;input original_credit_provider $1-32;&lt;/P&gt;&lt;P&gt;ocp=prxchange("s/PTY\.? (Limited|Ltd\.?)//i", -1, original_credit_provider);&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;ABC Pty. Ltd.&lt;/P&gt;&lt;P&gt;ABC Pty. Limited&lt;/P&gt;&lt;P&gt;ABC Pty Limited&lt;/P&gt;&lt;P&gt;ABC Pty Ltd.&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jun 2012 08:00:29 GMT</pubDate>
    <dc:creator>Alpay</dc:creator>
    <dc:date>2012-06-28T08:00:29Z</dc:date>
    <item>
      <title>Replace strings using prxchange</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Replace-strings-using-prxchange/m-p/94479#M26730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS users,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to replace company type chracters such as LTD, limited, ltd. etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;So far I have done:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; test3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; test2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; ocp=prxchange(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;"s/([Pp][Tt][Yy] [Ll][Tt][Dd])|([Ll]imite&lt;D&gt;)|([Ll]t&lt;D&gt;)|([Pp]t&lt;Y&gt;)|([Pp][Tt][Yy] [Ll]imite&lt;D&gt;) / /"&lt;/D&gt;&lt;/Y&gt;&lt;/D&gt;&lt;/D&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;, -&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;, original_credit_provider);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 10pt;"&gt;*if _n_=68;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;At the moment, I cannot deal with the ones that ends with a ".". How would you modify the above regular expression paraemter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;so that it can perform prxchange for values such as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;ABC Pty. Ltd. =&amp;gt; ABC&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;ABC Pty. Ltd. =&amp;gt; ABC&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Also, is there something to ensure that this string replace is done from the right end of each string?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Many thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 04:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Replace-strings-using-prxchange/m-p/94479#M26730</guid>
      <dc:creator>willy0625</dc:creator>
      <dc:date>2012-06-28T04:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Replace strings using prxchange</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Replace-strings-using-prxchange/m-p/94480#M26731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data test2;
 input original_credit_provider &amp;amp; $20.;
cards;
ABC Pty. Ltd.
ABC Pty. Ltd.
;
run;
data test3;
set test2;
ocp=prxchange("s/([Pp][Tt][Yy]\.? [Ll][Tt][Dd]\.?)|([Ll]imite&lt;D&gt;)|([Ll]t&lt;D&gt;)|([Pp]t&lt;Y&gt;)|([Pp][Tt][Yy] [Ll]imite&lt;D&gt;) / /", -1, original_credit_provider);
run;
&lt;/D&gt;&lt;/Y&gt;&lt;/D&gt;&lt;/D&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 05:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Replace-strings-using-prxchange/m-p/94480#M26731</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-06-28T05:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Replace strings using prxchange</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Replace-strings-using-prxchange/m-p/94481#M26732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may also use "i" option to make search case insensitive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;length original_credit_provider $32;&lt;/P&gt;&lt;P&gt;input original_credit_provider $1-32;&lt;/P&gt;&lt;P&gt;ocp=prxchange("s/PTY\.? (Limited|Ltd\.?)//i", -1, original_credit_provider);&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;ABC Pty. Ltd.&lt;/P&gt;&lt;P&gt;ABC Pty. Limited&lt;/P&gt;&lt;P&gt;ABC Pty Limited&lt;/P&gt;&lt;P&gt;ABC Pty Ltd.&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 08:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Replace-strings-using-prxchange/m-p/94481#M26732</guid>
      <dc:creator>Alpay</dc:creator>
      <dc:date>2012-06-28T08:00:29Z</dc:date>
    </item>
  </channel>
</rss>

