<?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 Add 0 before number in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298214#M60320</link>
    <description>&lt;P&gt;If it is already stored as character, do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;zipcode = put(input(zipcode,best.),z6.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;else, you need to convert to character:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;zipcode_char = put(zipcode,z6.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or you simply assign it the format for display:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format zipcode z6.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Sep 2016 05:08:51 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-09-14T05:08:51Z</dc:date>
    <item>
      <title>How to Add 0 before number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298212#M60319</link>
      <description>I've N number of zip codes but I need zip code minimum should be 6 numbers if less then it should prefix with '0'. Please help me on this&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Sep 2016 04:55:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298212#M60319</guid>
      <dc:creator>Ravikumarpa4</dc:creator>
      <dc:date>2016-09-14T04:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add 0 before number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298214#M60320</link>
      <description>&lt;P&gt;If it is already stored as character, do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;zipcode = put(input(zipcode,best.),z6.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;else, you need to convert to character:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;zipcode_char = put(zipcode,z6.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or you simply assign it the format for display:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format zipcode z6.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 05:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298214#M60320</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-14T05:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add 0 before number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298218#M60321</link>
      <description>Complete data in number format so I can use as format option right?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Ravikumar&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Wed, 14 Sep 2016 05:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298218#M60321</guid>
      <dc:creator>Ravikumarpa4</dc:creator>
      <dc:date>2016-09-14T05:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add 0 before number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298221#M60322</link>
      <description>&lt;P&gt;Depends. Try it and see if it meets your requirements.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 05:33:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298221#M60322</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-14T05:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add 0 before number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298222#M60323</link>
      <description>&lt;P&gt;Converting to number and then using a format provides for the simplest code. But you might to have to solve other issues (blanks within zipcodes etc) first for this to work.&lt;/P&gt;
&lt;P&gt;In this like in most other cases, testing beats speculating&lt;/P&gt;
&lt;P&gt;(German: "Probieren geht über studieren", English: "The proof of the pudding is in the eating")&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 05:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298222#M60323</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-14T05:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add 0 before number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298244#M60324</link>
      <description>&lt;P&gt;Whilst I agree with the above, if number convert is easiest, if the data contains non numerics that isn't going to work, so here is a text version:&lt;/P&gt;
&lt;PRE&gt;data want;
  input zip $;
  if lengthn(zip) &amp;lt; 6 then zip=cats(repeat("0",5-lengthn(zip)),zip);
datalines;
12345
123456
12AE4
1
;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 08:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Add-0-before-number/m-p/298244#M60324</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-09-14T08:33:29Z</dc:date>
    </item>
  </channel>
</rss>

