<?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: Adding leading zeros to numeric fields in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192684#M48383</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;FFirst age variable in dataset is numeric with length 8&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;then I changed like this &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data x (drop= age);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set y;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;old_age= put( age,2.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;then in another data step i converted to &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: rgba(255, 255, 255, 0);"&gt;i have used&amp;nbsp; Newage= put(input(old_age,best2.),z2.); I&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: rgba(255, 255, 255, 0);"&gt;whren I am exporting to Csv.&amp;nbsp;&amp;nbsp;&amp;nbsp; I don't c any leading zeros&amp;nbsp;&amp;nbsp; And&amp;nbsp;&amp;nbsp; in document.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: rgba(255, 255, 255, 0);"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: rgba(255, 255, 255, 0);"&gt;AGe.&amp;nbsp;&amp;nbsp; Format.&amp;nbsp; I3.&amp;nbsp;&amp;nbsp;&amp;nbsp; I3 = Integer 3 so what format new age should be numeric or character &lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 21px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Dec 2014 17:36:07 GMT</pubDate>
    <dc:creator>chennupriya</dc:creator>
    <dc:date>2014-12-04T17:36:07Z</dc:date>
    <item>
      <title>Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192674#M48373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;HHi,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;hi hi I want to add leading zeros to numeric fields and the docurgent the format is I3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;tthat is Integer 3 it means when age is 36 we don't need to add leading zeros because 36 is 2 bytes and +sign occupies 1byte &lt;/P&gt;&lt;P&gt;but when age is 8 then add one leading zero . Can anybody suggest &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 20:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192674#M48373</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2014-12-02T20:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192675#M48374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you need a PICTURE format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; picture this low-high='99'&amp;nbsp; (prefix='+');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then when printing a variable, add:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;format varname this3.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 20:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192675#M48374</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-12-02T20:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192676#M48375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just for having leading zero's for numeric variables you can use the out-of-the-box Zw.d format for this.&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#p09lpr3kmbh8fen1qepuv6zc1ldd.htm" title="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#p09lpr3kmbh8fen1qepuv6zc1ldd.htm"&gt;SAS(R) 9.4 Formats and Informats: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not really sure what you're trying to explain with the bytes. I would have thought that for numeric variables the +/- consumes one bit only (and not a byte).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're dealing with character variables then please provide some representative sample data and then explain how the result should look like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 21:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192676#M48375</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-12-02T21:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192677#M48376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;HHi &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;i have used&amp;nbsp; Newage= put(input(old_age,best2.),z2.); I gave me leading zeros &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Old age &lt;/P&gt;&lt;P&gt;36&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;45&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;new age &lt;/P&gt;&lt;P&gt;36&lt;/P&gt;&lt;P&gt;02&lt;/P&gt;&lt;P&gt;45&lt;/P&gt;&lt;P&gt;06&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I am exporting data to csv file I am missing leading zeros &lt;/P&gt;&lt;P&gt;data in Csv file &lt;/P&gt;&lt;P&gt;36&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;45&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;can any one pls help me . &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 15:18:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192677#M48376</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2014-12-03T15:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192678#M48377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The zeros are in the CSV file, but you are probably opening the file in Excel and it is converting them back to a number.&lt;/P&gt;&lt;P&gt;Open the CSV file with a text editor and you will see the zeros.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 16:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192678#M48377</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-03T16:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192679#M48378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;No I am not seeing it . One of my collague is suggesting that everything in Csv shd be strings &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;so I don't understand what to do &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 16:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192679#M48378</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2014-12-03T16:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192680#M48379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Open your .csv file with a text editor like Notepad and check if you can see the zeros this way. If so then Tom's assumption is confirmed and we can discuss of how to write strings of digits to a .csv file so that when opening it in Excel digit strings don't get converted into numbers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 16:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192680#M48379</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-12-03T16:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192681#M48380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you did a SAVE in Excel it corrupted the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 16:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192681#M48380</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-12-03T16:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192682#M48381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I Opened it in text editor I don't find any leading zeros &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 17:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192682#M48381</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2014-12-03T17:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192683#M48382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to be sure that &lt;EM&gt;Newage&lt;/EM&gt; is a character variable with length=3, not a numeric one. Show your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CTorres&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 20:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192683#M48382</guid>
      <dc:creator>CTorres</dc:creator>
      <dc:date>2014-12-03T20:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192684#M48383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;FFirst age variable in dataset is numeric with length 8&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;then I changed like this &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data x (drop= age);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set y;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;old_age= put( age,2.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;then in another data step i converted to &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: rgba(255, 255, 255, 0);"&gt;i have used&amp;nbsp; Newage= put(input(old_age,best2.),z2.); I&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: rgba(255, 255, 255, 0);"&gt;whren I am exporting to Csv.&amp;nbsp;&amp;nbsp;&amp;nbsp; I don't c any leading zeros&amp;nbsp;&amp;nbsp; And&amp;nbsp;&amp;nbsp; in document.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: rgba(255, 255, 255, 0);"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: rgba(255, 255, 255, 0);"&gt;AGe.&amp;nbsp;&amp;nbsp; Format.&amp;nbsp; I3.&amp;nbsp;&amp;nbsp;&amp;nbsp; I3 = Integer 3 so what format new age should be numeric or character &lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 21px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 17:36:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192684#M48383</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2014-12-04T17:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192685#M48384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you making the CSV file?&lt;/P&gt;&lt;P&gt;You can read the CSV file with a data step and dump the lines to the SAS log to see if there are leading zeros.&amp;nbsp; For example this program will show the first 10 lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'myfile.csv' obs=10 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt; list;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the column is intended to be integer then why do you want leading zeros?&lt;/P&gt;&lt;P&gt;Also the column is specified as length 3 so why are you not using Z3 format?&amp;nbsp; Age should not be negative.&amp;nbsp; People do live to be over 99 years old.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 18:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192685#M48384</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-04T18:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192686#M48385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I Didn't understand what u you have said &lt;/P&gt;&lt;P&gt;i have not used z3 because for EG &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;23&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;i want only &lt;/P&gt;&lt;P&gt;23&lt;/P&gt;&lt;P&gt;03&lt;/P&gt;&lt;P&gt;04&lt;/P&gt;&lt;P&gt;but if I use z3 &lt;/P&gt;&lt;P&gt;the he output will be &lt;/P&gt;&lt;P&gt;023&lt;/P&gt;&lt;P&gt;003&lt;/P&gt;&lt;P&gt;004&lt;/P&gt;&lt;P&gt;but in I3 format one byte will be for sign and other two for digits&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 18:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192686#M48385</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2014-12-04T18:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192687#M48386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you generate a CSV file from the SAS dataset?&amp;nbsp; Did you call PROC EXPORT?&amp;nbsp; Did you use ODS CSV ?&amp;nbsp; Did you use a data step with DSD option on the FILE statement?&amp;nbsp; Did you use some functionality of Enterprise Guide?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you think that you need a leading zero?&amp;nbsp; What software are you planning to use the resulting CSV file with that would require the leading zero?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps you just need to explicitly include the sign into the new character variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;char_age = cats('+',put(age,z2.)) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What system is defining I3 to mean sign plus two digits?&amp;nbsp; I3 looks like a FORTRAN format specification and the sign is not required, but takes up one of the characters if present.&amp;nbsp; So '001' would be valid and so would '+01' or '-01'.&amp;nbsp; But '-101' would be too long since it would require 4 characters instead of three.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you sure that you even want a CSV file?&amp;nbsp; If your data definition is explicitly listing the number of columns for each variable then perhaps you want to generate a fixed field file instead of a comma separated file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 18:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192687#M48386</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-04T18:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192688#M48387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to review the information about SAS Variables. See&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/67885/HTML/default/viewer.htm#p1hl9hzbtcm1rnn1ub746qoyku1k.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/67885/HTML/default/viewer.htm#p1hl9hzbtcm1rnn1ub746qoyku1k.htm"&gt;SAS(R) 9.4 Language Reference: Concepts, Fourth Edition&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are only two types of variables in SAS: numeric and character. The numeric variables are stored in 8 bytes of memory in Float-Point internal representation (Machine)&lt;/P&gt;&lt;P&gt;The format in SAS allows different ways to present or display in reports (human) the value stored in a numeric variable which includes dates, datetimes and times. The format does not change in any way the numeric variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ctorres&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 18:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192688#M48387</guid>
      <dc:creator>CTorres</dc:creator>
      <dc:date>2014-12-04T18:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192689#M48388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;HHi tom ,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;to age variable I used the syntax u gave me the result is &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+36&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+02&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+04&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;i am using SAS EG I&amp;nbsp; am exporting SAS dataset using export to in SaS EG and saving in my c drive as a Csv file &lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 19:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192689#M48388</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2014-12-04T19:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Adding leading zeros to numeric fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192690#M48389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I used EG 6.1 (with local SAS 9.4) and ran a simple program step to make an example file with one numeric and one character variable.&lt;/P&gt;&lt;P&gt;I then used both the interactive export and the export as a step in project flow to export the data set as a CSV.&amp;nbsp; The files were identical and both included the leading zeros.&amp;nbsp; Plus when I did the conversion as a step in the process flow then Enterprise Guide let be browse the created CSV file so that I could confirm that the leading zeros where there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried just attaching the Z2. format to the numeric variable with a FORMAT statement in the step that made the data and that also generated leading zeros in the CSV file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that something down stream from SAS is removing the leading zeros for you.&amp;nbsp; For example if you double click on a CSV file and open it with Excel then Excel will convert anything that looks like a number to a number and leading zeros will be lost.&amp;nbsp; If the goal is to use this data with Excel then export it to an XLS or XLSX file instead of a CSV file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 21:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-leading-zeros-to-numeric-fields/m-p/192690#M48389</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-04T21:05:57Z</dc:date>
    </item>
  </channel>
</rss>

