<?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 Leadin 0's Removal in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49112#M10147</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Is there any SAS function that will remove all leading zeop from a string ? I check all the CAT(x) functions but non of them deal with leading zero alone.&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
    <pubDate>Fri, 29 Jan 2010 19:58:33 GMT</pubDate>
    <dc:creator>Kwok</dc:creator>
    <dc:date>2010-01-29T19:58:33Z</dc:date>
    <item>
      <title>Leadin 0's Removal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49112#M10147</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Is there any SAS function that will remove all leading zeop from a string ? I check all the CAT(x) functions but non of them deal with leading zero alone.&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Fri, 29 Jan 2010 19:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49112#M10147</guid>
      <dc:creator>Kwok</dc:creator>
      <dc:date>2010-01-29T19:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Leadin 0's Removal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49113#M10148</link>
      <description>The presumption here is that you are dealing with a SAS CHARACTER variable - one that has zero character(s) as part of the string?  If so, look at using the combination of an INPUT function invocation (to convert the number char-string to a SAS NUMERIC variable, and then using the PUT function in an assignment statement to convert back to character -- add the -l operand as part of the PUT function's second argument to left-justify, if desired.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Recommended Google advanced search argument for this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
convert number character remove leading zeros site:sas.com</description>
      <pubDate>Fri, 29 Jan 2010 20:11:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49113#M10148</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-01-29T20:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Leadin 0's Removal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49114#M10149</link>
      <description>maybe&lt;BR /&gt;
&lt;BR /&gt;
x=translate(left(translate(x,' 0','0 ')),' 0','0 ');&lt;BR /&gt;
&lt;BR /&gt;
this should switch 0's and ' ', take off the leading blanks and switch back any 0's and ' '</description>
      <pubDate>Fri, 29 Jan 2010 20:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49114#M10149</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-01-29T20:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Leadin 0's Removal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49115#M10150</link>
      <description>An alternative using the "new" SUBSTRN function.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
99   data _null_;&lt;BR /&gt;
100     input s:$20.;&lt;BR /&gt;
101     z = substrn(s,verify(s,'0'));&lt;BR /&gt;
102     put 'NOTE: '(_all_)(=);&lt;BR /&gt;
103     cards;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: s=000ABC z=ABC&lt;BR /&gt;
NOTE: s=00aa z=aa&lt;BR /&gt;
NOTE: s=001 z=1&lt;BR /&gt;
NOTE: s=100 z=100&lt;BR /&gt;
NOTE: s=Help z=Help&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 29 Jan 2010 21:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49115#M10150</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-01-29T21:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Leadin 0's Removal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49116#M10151</link>
      <description>Thanks for all your sample codes. The issue solved.&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
David</description>
      <pubDate>Mon, 01 Feb 2010 13:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leadin-0-s-Removal/m-p/49116#M10151</guid>
      <dc:creator>Kwok</dc:creator>
      <dc:date>2010-02-01T13:42:32Z</dc:date>
    </item>
  </channel>
</rss>

