<?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: fill the digits with zero in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/fill-the-digits-with-zero/m-p/673491#M23500</link>
    <description>&lt;P&gt;Assuming these are numbers then the following will work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;age_displayed_format shows how to change the &lt;STRONG&gt;format&lt;/STRONG&gt; for display. This does not change the underlying values so you can still do calculations if necessary. Sorts will be numeric still.&lt;/P&gt;
&lt;P&gt;age_converted shows how to change the &lt;STRONG&gt;type&lt;/STRONG&gt; into a character and you cannot do mathematical calculations on the variable any longer. Sorts will be alphabetic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think in this case the sort issue matters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set sashelp.class;

age_displayed_format = age;
format age_displayed_format z5.;

age_converted = put(age, z5.);
format age_converted $5.;

run;

proc print data=want;
var age:;
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/329198"&gt;@Smitha9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a data example:&lt;/P&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;20&lt;/P&gt;
&lt;P&gt;345&lt;/P&gt;
&lt;P&gt;4654&lt;/P&gt;
&lt;P&gt;I want to make the above ID to 5digits by filling the initial digits with Zero.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;P&gt;00001&lt;/P&gt;
&lt;P&gt;00020&lt;/P&gt;
&lt;P&gt;00345&lt;/P&gt;
&lt;P&gt;04654&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can anyone help me with this? thank you in advance&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jul 2020 16:32:09 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-07-30T16:32:09Z</dc:date>
    <item>
      <title>fill the digits with zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/fill-the-digits-with-zero/m-p/673489#M23499</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a data example:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;20&lt;/P&gt;&lt;P&gt;345&lt;/P&gt;&lt;P&gt;4654&lt;/P&gt;&lt;P&gt;I want to make the above ID to 5digits by filling the initial digits with Zero.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;00001&lt;/P&gt;&lt;P&gt;00020&lt;/P&gt;&lt;P&gt;00345&lt;/P&gt;&lt;P&gt;04654&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone help me with this? thank you in advance&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 16:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/fill-the-digits-with-zero/m-p/673489#M23499</guid>
      <dc:creator>Smitha9</dc:creator>
      <dc:date>2020-07-30T16:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: fill the digits with zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/fill-the-digits-with-zero/m-p/673491#M23500</link>
      <description>&lt;P&gt;Assuming these are numbers then the following will work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;age_displayed_format shows how to change the &lt;STRONG&gt;format&lt;/STRONG&gt; for display. This does not change the underlying values so you can still do calculations if necessary. Sorts will be numeric still.&lt;/P&gt;
&lt;P&gt;age_converted shows how to change the &lt;STRONG&gt;type&lt;/STRONG&gt; into a character and you cannot do mathematical calculations on the variable any longer. Sorts will be alphabetic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think in this case the sort issue matters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set sashelp.class;

age_displayed_format = age;
format age_displayed_format z5.;

age_converted = put(age, z5.);
format age_converted $5.;

run;

proc print data=want;
var age:;
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/329198"&gt;@Smitha9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a data example:&lt;/P&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;20&lt;/P&gt;
&lt;P&gt;345&lt;/P&gt;
&lt;P&gt;4654&lt;/P&gt;
&lt;P&gt;I want to make the above ID to 5digits by filling the initial digits with Zero.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;P&gt;00001&lt;/P&gt;
&lt;P&gt;00020&lt;/P&gt;
&lt;P&gt;00345&lt;/P&gt;
&lt;P&gt;04654&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can anyone help me with this? thank you in advance&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 16:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/fill-the-digits-with-zero/m-p/673491#M23500</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-30T16:32:09Z</dc:date>
    </item>
  </channel>
</rss>

