<?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 SQL to remove only 00 in a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-remove-only-00-in-a-string/m-p/912696#M359776</link>
    <description>&lt;P&gt;Any help to remove 00 from the records below via proc sql? I want to display blanks if the records has multiple 00s without any alphabets&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;00,CQ,GC
00,RT,00,IR
00,00
RT,GT,KL
100,1000,00,RT&lt;/PRE&gt;
&lt;P&gt;Excepted Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;CQ,GC
RT,IR

RT,GT,KL
100,1000,RT&lt;/PRE&gt;</description>
    <pubDate>Tue, 23 Jan 2024 14:18:53 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2024-01-23T14:18:53Z</dc:date>
    <item>
      <title>SQL to remove only 00 in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-remove-only-00-in-a-string/m-p/912696#M359776</link>
      <description>&lt;P&gt;Any help to remove 00 from the records below via proc sql? I want to display blanks if the records has multiple 00s without any alphabets&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;00,CQ,GC
00,RT,00,IR
00,00
RT,GT,KL
100,1000,00,RT&lt;/PRE&gt;
&lt;P&gt;Excepted Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;CQ,GC
RT,IR

RT,GT,KL
100,1000,RT&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Jan 2024 14:18:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-remove-only-00-in-a-string/m-p/912696#M359776</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2024-01-23T14:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: SQL to remove only 00 in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-remove-only-00-in-a-string/m-p/912730#M359781</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start with the Perl regular expression below ...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input c $char60.;
cards;
00,CQ,GC
00,RT,00,IR
00,00
RT,GT,KL
100,1000,00,RT
;

proc sql;
create table want as
select prxchange('s/,00\b|\b00\b,?//',-1,c) as c length=60
from have;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;... and then modify it if necessary, e.g., to include space characters:&lt;/P&gt;
&lt;PRE&gt;select prxchange('s/,&lt;STRONG&gt;\s*&lt;/STRONG&gt;00\b&lt;STRONG&gt;\s*&lt;/STRONG&gt;|&lt;STRONG&gt;\s*&lt;/STRONG&gt;\b00\b,?&lt;STRONG&gt;\s*&lt;/STRONG&gt;//',-1,c) as c length=60&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Jan 2024 16:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-remove-only-00-in-a-string/m-p/912730#M359781</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-01-23T16:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: SQL to remove only 00 in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-to-remove-only-00-in-a-string/m-p/912805#M359789</link>
      <description>&lt;P&gt;I believe for your sample data the 2nd expression from the OR condition&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;proposes is sufficient. Because you wrote MULTIPLE and not EXACTLY TWO zeros I've also added a + (one or many) after the second zero.&lt;/P&gt;
&lt;PRE&gt;select prxchange('s/\b00&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;\b,?//',-1,trim(c)) as c length=60&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 10:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-to-remove-only-00-in-a-string/m-p/912805#M359789</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-24T10:36:12Z</dc:date>
    </item>
  </channel>
</rss>

