<?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: Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;amp;”. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-AND-ET-Y-UND-and-so-on-to-amp/m-p/536837#M147578</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/262815"&gt;@Alexxxxxxx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a &amp;nbsp;company name standardisation process, I expect to 'Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;amp;”. &amp;nbsp;and Remove all other punctuation.'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I would like to do it by following steps,&lt;/P&gt;
&lt;P&gt;1. split a variable into several independent variables.&lt;/P&gt;
&lt;P&gt;2. Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;amp;”.&lt;/P&gt;
&lt;P&gt;3. Remove all other punctuation.&lt;/P&gt;
&lt;P&gt;4. merge them together ( both keep the original variable and new variable).&lt;/P&gt;
&lt;P&gt;5. create a new variable to remind me of what the change happen (i.e., 'convert to &amp;amp;', 'remove&amp;nbsp;punctuation' or 'both')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please give me some suggestion about this?&lt;/P&gt;
&lt;P&gt;Thanks for your attention to this matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;1. SCAN(), SUBSTR() or PRX()&lt;/P&gt;
&lt;P&gt;2. TRANWRD()&lt;/P&gt;
&lt;P&gt;3. COMPRESS()&lt;/P&gt;
&lt;P&gt;4. CATT()&lt;/P&gt;
&lt;P&gt;5. No idea.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check character functions here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=nlsref&amp;amp;docsetTarget=p0ydidiqibf0vbn1jljj1cv9men9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=nlsref&amp;amp;docsetTarget=p0ydidiqibf0vbn1jljj1cv9men9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Feb 2019 17:48:47 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-02-19T17:48:47Z</dc:date>
    <item>
      <title>Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;”.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-AND-ET-Y-UND-and-so-on-to-amp/m-p/536816#M147575</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a &amp;nbsp;company name standardisation process, I expect to 'Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;amp;”. &amp;nbsp;and Remove all other punctuation.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I would like to do it by following steps,&lt;/P&gt;&lt;P&gt;1. split a variable into several independent variables.&lt;/P&gt;&lt;P&gt;2. Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;amp;”.&lt;/P&gt;&lt;P&gt;3. Remove all other punctuation.&lt;/P&gt;&lt;P&gt;4. merge them together ( both keep the original variable and new variable).&lt;/P&gt;&lt;P&gt;5. create a new variable to remind me of what the change happen (i.e., 'convert to &amp;amp;', 'remove&amp;nbsp;punctuation' or 'both')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please give me some suggestion about this?&lt;/P&gt;&lt;P&gt;Thanks for your attention to this matter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 16:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-AND-ET-Y-UND-and-so-on-to-amp/m-p/536816#M147575</guid>
      <dc:creator>Alexxxxxxx</dc:creator>
      <dc:date>2019-02-19T16:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;”.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-AND-ET-Y-UND-and-so-on-to-amp/m-p/536818#M147576</link>
      <description>&lt;P&gt;Can you please post a sample data of what you HAVE and WANT?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 16:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-AND-ET-Y-UND-and-so-on-to-amp/m-p/536818#M147576</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-02-19T16:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;”.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-AND-ET-Y-UND-and-so-on-to-amp/m-p/536837#M147578</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/262815"&gt;@Alexxxxxxx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a &amp;nbsp;company name standardisation process, I expect to 'Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;amp;”. &amp;nbsp;and Remove all other punctuation.'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I would like to do it by following steps,&lt;/P&gt;
&lt;P&gt;1. split a variable into several independent variables.&lt;/P&gt;
&lt;P&gt;2. Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;amp;”.&lt;/P&gt;
&lt;P&gt;3. Remove all other punctuation.&lt;/P&gt;
&lt;P&gt;4. merge them together ( both keep the original variable and new variable).&lt;/P&gt;
&lt;P&gt;5. create a new variable to remind me of what the change happen (i.e., 'convert to &amp;amp;', 'remove&amp;nbsp;punctuation' or 'both')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please give me some suggestion about this?&lt;/P&gt;
&lt;P&gt;Thanks for your attention to this matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;1. SCAN(), SUBSTR() or PRX()&lt;/P&gt;
&lt;P&gt;2. TRANWRD()&lt;/P&gt;
&lt;P&gt;3. COMPRESS()&lt;/P&gt;
&lt;P&gt;4. CATT()&lt;/P&gt;
&lt;P&gt;5. No idea.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check character functions here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=nlsref&amp;amp;docsetTarget=p0ydidiqibf0vbn1jljj1cv9men9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=nlsref&amp;amp;docsetTarget=p0ydidiqibf0vbn1jljj1cv9men9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 17:48:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-AND-ET-Y-UND-and-so-on-to-amp/m-p/536837#M147578</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-19T17:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert “AND”, “ET”, “Y”, “UND” and so on, to “&amp;”.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-AND-ET-Y-UND-and-so-on-to-amp/m-p/536841#M147579</link>
      <description>&lt;P&gt;Use prxChange:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
length text newText $64;
do text = "Procter and Gamble", "Greyhound Lines", "Moët et Chandon";
    newText = prxChange("s/\b(AND|ET|Y|UND)\b/&amp;amp;/io", -1, text);
    put (_all_) (=);
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;text=Procter and Gamble newText=Procter &amp;amp; Gamble
text=Greyhound Lines newText=Greyhound Lines
text=Moët et Chandon newText=Moët &amp;amp; Chandon
&lt;/PRE&gt;
&lt;P&gt;Compare text and newText to detect any change.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 17:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-AND-ET-Y-UND-and-so-on-to-amp/m-p/536841#M147579</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-02-19T17:52:22Z</dc:date>
    </item>
  </channel>
</rss>

