<?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: SAS prxmatch and Replace Next String in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-prxmatch-and-Replace-Next-String/m-p/336120#M76169</link>
    <description>&lt;P&gt;My first action would be to parse the free text into dataset variables, so I'd have a dataset with separate columns like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dlm=',' truncover;
input name :$20. dob :yymmdd10.;
format dob yymmddd10.;
cards;
John Doe,1991-10-10
John Miller,2001-01-30
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then it's very simple&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if index(name,'John Doe') &amp;gt; 0
then do;
  name = 'XXX';
  dob = .;
end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 27 Feb 2017 08:50:04 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-02-27T08:50:04Z</dc:date>
    <item>
      <title>SAS prxmatch and Replace Next String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-prxmatch-and-Replace-Next-String/m-p/336103#M76165</link>
      <description>&lt;P&gt;I have a free text column which I need to delete and replace some sections. I'm able to use prxchange for those with known structures such as employee id, postal code. But I also need to mask names and other sensitive information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input Free Text:&lt;/P&gt;&lt;P&gt;Name:&amp;nbsp;John Doe&lt;/P&gt;&lt;P&gt;DOB: 1991-10-10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output Cleansed Text:&lt;/P&gt;&lt;P&gt;Name: XXX&lt;/P&gt;&lt;P&gt;DOB: YYYY-MM-DD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way I can use prxmatch then if it matches a portion I will manipulate the succeeding string next to it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 07:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-prxmatch-and-Replace-Next-String/m-p/336103#M76165</guid>
      <dc:creator>milts</dc:creator>
      <dc:date>2017-02-27T07:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS prxmatch and Replace Next String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-prxmatch-and-Replace-Next-String/m-p/336120#M76169</link>
      <description>&lt;P&gt;My first action would be to parse the free text into dataset variables, so I'd have a dataset with separate columns like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dlm=',' truncover;
input name :$20. dob :yymmdd10.;
format dob yymmddd10.;
cards;
John Doe,1991-10-10
John Miller,2001-01-30
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then it's very simple&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if index(name,'John Doe') &amp;gt; 0
then do;
  name = 'XXX';
  dob = .;
end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Feb 2017 08:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-prxmatch-and-Replace-Next-String/m-p/336120#M76169</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-27T08:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS prxmatch and Replace Next String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-prxmatch-and-Replace-Next-String/m-p/336830#M76399</link>
      <description>&lt;P&gt;Thanks for your inputs. However, my data won't be clean as such. The fields that I need to cleanse and mask will be stored in a single field (example would be this response. everything will be in one field) which is a bit challenge for SAS unlike if I do it in either python or R where I can tokenize all the strings in the field. I'm just trying to weigh in options on which tool would be the most suitable to use for my requirement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 03:47:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-prxmatch-and-Replace-Next-String/m-p/336830#M76399</guid>
      <dc:creator>milts</dc:creator>
      <dc:date>2017-03-01T03:47:47Z</dc:date>
    </item>
  </channel>
</rss>

