<?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: How to change &amp;quot;001234&amp;quot; to &amp;quot;1234&amp;quot; in all rows of a column? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-quot-001234-quot-to-quot-1234-quot-in-all-rows-of/m-p/716344#M221367</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
       y=substr(x,1,2)
       If y="00" then x1=substr(x,3,4);&lt;BR /&gt;      else x1=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/367548"&gt;@Sandra94&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;In one of my columns in the dataset I have customerIDs with "00" added before. I want to delete it at all rows.&lt;/P&gt;
&lt;P&gt;Is this possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Sandra&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
     if substr(customerIDs,1,2) ="00" then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 03 Feb 2021 08:48:41 GMT</pubDate>
    <dc:creator>Phil_NZ</dc:creator>
    <dc:date>2021-02-03T08:48:41Z</dc:date>
    <item>
      <title>How to change "001234" to "1234" in all rows of a column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-quot-001234-quot-to-quot-1234-quot-in-all-rows-of/m-p/716341#M221364</link>
      <description>&lt;P&gt;How to change "001234" to "1234" in all rows of a column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In one of my columns in the dataset I have customerIDs with "00" added before. I want to delete it at all rows.&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 08:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-quot-001234-quot-to-quot-1234-quot-in-all-rows-of/m-p/716341#M221364</guid>
      <dc:creator>Sandra94</dc:creator>
      <dc:date>2021-02-03T08:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to change "001234" to "1234" in all rows of a column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-quot-001234-quot-to-quot-1234-quot-in-all-rows-of/m-p/716343#M221366</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   CustomerID = "001234";
run;

data want;
   set have;
   id = substr(CustomerID, verify(CustomerID,'0'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Feb 2021 08:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-quot-001234-quot-to-quot-1234-quot-in-all-rows-of/m-p/716343#M221366</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-02-03T08:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to change "001234" to "1234" in all rows of a column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-quot-001234-quot-to-quot-1234-quot-in-all-rows-of/m-p/716344#M221367</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
       y=substr(x,1,2)
       If y="00" then x1=substr(x,3,4);&lt;BR /&gt;      else x1=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/367548"&gt;@Sandra94&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;In one of my columns in the dataset I have customerIDs with "00" added before. I want to delete it at all rows.&lt;/P&gt;
&lt;P&gt;Is this possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Sandra&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
     if substr(customerIDs,1,2) ="00" then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Feb 2021 08:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-quot-001234-quot-to-quot-1234-quot-in-all-rows-of/m-p/716344#M221367</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-02-03T08:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to change "001234" to "1234" in all rows of a column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-quot-001234-quot-to-quot-1234-quot-in-all-rows-of/m-p/716348#M221371</link>
      <description>&lt;P&gt;I understand that the variable CustomerID is char type and its length is 6.&lt;/P&gt;
&lt;P&gt;Alternative ways to those already posted:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) customeID = put(input(customeID ,6.),6.);&lt;/P&gt;
&lt;P&gt;2) Change the type of the variable to numeric:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set have(rename=(customeID =CID));
       customeID = input(CID,6.);
       format customeID 6.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Feb 2021 09:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-quot-001234-quot-to-quot-1234-quot-in-all-rows-of/m-p/716348#M221371</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-03T09:17:03Z</dc:date>
    </item>
  </channel>
</rss>

