<?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: Removing non-standard text when cleaning data - Substring, PRXCHANGE? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784767#M39952</link>
    <description>Your examples all seem to have it at the end and same pattern. Can you provide a more representative example and also include what you're looking for as your final output.</description>
    <pubDate>Tue, 07 Dec 2021 21:44:41 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-12-07T21:44:41Z</dc:date>
    <item>
      <title>Removing non-standard text when cleaning data - Substring, PRXCHANGE?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784765#M39951</link>
      <description>&lt;P&gt;I am standardizing unit names, however many of them contain a non-standard indicator at the end of the unit name (it denotes geographically separated but part of the same unit). I need to remove this final string so these units can later be combined into one unit.&amp;nbsp;&lt;SPAN&gt;Typically I would substring this, but the indicator 1) does not occur on every unit name, 2) is not in a standard position in the string, and 3)&amp;nbsp;the final sting itself isn't consistent in the use of digit vs character starting in position 3 (see below).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examples of the unit names:&lt;/P&gt;&lt;P&gt;SURGICAL &lt;FONT color="#000000"&gt;OPS OLA900&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;SURGICAL OPS&lt;/SPAN&gt; OLHC00&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;EDU AND TRNG OL0IZH&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;EDU AND TRNG&lt;/SPAN&gt; OL0PZR&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;LEGAL OLCS00&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;LEGAL OLA200&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final sting always starts with " OL". &lt;SPAN&gt;Searches have brought me to PRXCHANGE, but as I've read in forums and found out myself, the syntax is particularly confusing.&amp;nbsp;&lt;/SPAN&gt;What is your best practice recommendation in this situation?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 21:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784765#M39951</guid>
      <dc:creator>vbylsma</dc:creator>
      <dc:date>2021-12-07T21:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Removing non-standard text when cleaning data - Substring, PRXCHANGE?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784767#M39952</link>
      <description>Your examples all seem to have it at the end and same pattern. Can you provide a more representative example and also include what you're looking for as your final output.</description>
      <pubDate>Tue, 07 Dec 2021 21:44:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784767#M39952</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-12-07T21:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Removing non-standard text when cleaning data - Substring, PRXCHANGE?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784810#M39953</link>
      <description>Given that the string always begins the final word, here's one way:&lt;BR /&gt;&lt;BR /&gt;delete_here = index(unit, ' OL');&lt;BR /&gt;if delete_here then&lt;BR /&gt;unit = substr(unit, 1, delete_here);</description>
      <pubDate>Wed, 08 Dec 2021 02:50:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784810#M39953</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-12-08T02:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Removing non-standard text when cleaning data - Substring, PRXCHANGE?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784880#M39957</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input have $40.;
want=prxchange('s/\bOL\w+$//i',1,strip(have));
cards;
SURGICAL OPS OLA900
SURGICAL OPS OLHC00
EDU AND TRNG OL0IZH
EDU AND TRNG OL0PZR
LEGAL OLCS00
LEGAL OLA200
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Dec 2021 11:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784880#M39957</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-12-08T11:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Removing non-standard text when cleaning data - Substring, PRXCHANGE?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784897#M39958</link>
      <description>This also worked, thank you so much!</description>
      <pubDate>Wed, 08 Dec 2021 13:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784897#M39958</guid>
      <dc:creator>vbylsma</dc:creator>
      <dc:date>2021-12-08T13:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Removing non-standard text when cleaning data - Substring, PRXCHANGE?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784898#M39959</link>
      <description>This worked AND I learned a lot about PRXCHANGE. Thank you!</description>
      <pubDate>Wed, 08 Dec 2021 13:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-non-standard-text-when-cleaning-data-Substring/m-p/784898#M39959</guid>
      <dc:creator>vbylsma</dc:creator>
      <dc:date>2021-12-08T13:21:01Z</dc:date>
    </item>
  </channel>
</rss>

