<?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: Proc export .csv with leading zeros in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214189#M52785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Kurt, open the csv in a notepad and the leading zeros are probably there.&amp;nbsp; If this is being read into another software (tableau) you'll have to check that they are pulling the leading zeros with the correct informat.&amp;nbsp; If you are opening it into excel the format will not be saved, a work around is to copy and paste it into excel if that's where you need it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2015 12:46:13 GMT</pubDate>
    <dc:creator>Steelers_In_DC</dc:creator>
    <dc:date>2015-05-13T12:46:13Z</dc:date>
    <item>
      <title>Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214187#M52783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've used the following code to export my dataset to .csv. However I could not see leading zeros for one of the variable 'zip'?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc export data=country outfile="/data/country.csv" dbms=csv replace;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the better way to output .csv with leading zeros?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran this code in EG 7.1 with SAS version 9.3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 12:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214187#M52783</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-13T12:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214188#M52784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you taken a look at the csv file itself?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a column is numeric, assign it a Zw. format so that leading zeroes are printed in the .csv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, if you see leading zeroes in the .csv file, the problem lies with the software used to read the .csv.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 12:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214188#M52784</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-13T12:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214189#M52785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Kurt, open the csv in a notepad and the leading zeros are probably there.&amp;nbsp; If this is being read into another software (tableau) you'll have to check that they are pulling the leading zeros with the correct informat.&amp;nbsp; If you are opening it into excel the format will not be saved, a work around is to copy and paste it into excel if that's where you need it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 12:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214189#M52785</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-05-13T12:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214190#M52786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'Zip' variable in my dataset is character not numeric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 13:16:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214190#M52786</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-13T13:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214191#M52787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Understood, are you opening this file in excel, or another similar database application?&amp;nbsp; If so it's that application that is dropping the character format.&amp;nbsp; Try opening it in notepad and I suspect that you will see the leading zeros as intended.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 13:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214191#M52787</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-05-13T13:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214192#M52788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I opening it in excel. So don't we've any other better ways to view the leading zeros in excel?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 14:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214192#M52788</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-13T14:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214193#M52789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;If you are opening the CSV file with Excel, then using PROC EXPORT will not cause Excel to "respect" the SAS format. Excel has a default way that it treats numbers and leading zeros are ignored when you have a CSV file or other file. You need to send a Microsoft format from SAS to Excel using the Output Delivery System. This paper &lt;A href="https://support.sas.com/resources/papers/proceedings11/266-2011.pdf" title="https://support.sas.com/resources/papers/proceedings11/266-2011.pdf"&gt;https://support.sas.com/resources/papers/proceedings11/266-2011.pdf&lt;/A&gt; shows the 2 methods: HTMLSTYLE override or TAGATTR override. The one you choose will correspond to the ODS destination (HTML or XML) you use. Leading zeroes are shown on page 6-7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 14:07:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214193#M52789</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-05-13T14:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214194#M52790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OR try ODS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods csv file='c:\temp\x.csv' ;&lt;/P&gt;&lt;P&gt;proc print data=x noobs;run;&lt;/P&gt;&lt;P&gt;ods csv close;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 14:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214194#M52790</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-13T14:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214195#M52791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a piece of ods code that I use frequently, it has a few different formats that you can see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods _all_ close;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP path='/export/home/pp78499/sasuser.v92' file='QC13_OUTPUT.xml'&lt;/P&gt;&lt;P&gt;style=printer;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP options(sheet_name='SUM_AT_FACILITY' AUTOFILTER = 'ALL'); /* add sheet name and filter*/&lt;/P&gt;&lt;P&gt;proc print data=SUM_AT_FACILITY noobs;&lt;/P&gt;&lt;P&gt;var power_id facility_id / style(column)={tagattr='Format:@'}; /* format as character for leading zeros */&lt;/P&gt;&lt;P&gt;var ead_date_end sum_trans / style={tagattr='Format:#,###'};run;quit; /* format comma */&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP options(sheet_name='BCR_TRANSACTIONS' AUTOFILTER = 'ALL');&lt;/P&gt;&lt;P&gt;proc print data=BCR_TRANSACTIONS noobs;&lt;/P&gt;&lt;P&gt;var power_id facility_id acct_full_acct_id / style(column)={tagattr='Format:@'}; &lt;/P&gt;&lt;P&gt;var _all_ ;run;quit;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP options(sheet_name='WBDW_DATE' AUTOFILTER = 'ALL');&lt;/P&gt;&lt;P&gt;proc print data=WBDW_DATE noobs;&lt;/P&gt;&lt;P&gt;var power_id facility_id acct_full_acct_id / style(column)={tagattr='Format:@'}; &lt;/P&gt;&lt;P&gt;var _all_ ;run;quit;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP options(sheet_name='LGD_ABS' AUTOFILTER = 'ALL');&lt;/P&gt;&lt;P&gt;proc print data=LGD_ABS noobs;&lt;/P&gt;&lt;P&gt;var power_id facility_id acct_full_acct_id / style(column)={tagattr='Format:@'};&lt;/P&gt;&lt;P&gt;var _all_ ;run;quit;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP close;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 14:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214195#M52791</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-05-13T14:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214196#M52792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 14:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214196#M52792</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-13T14:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214197#M52793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Document which you suggested deals with leading zeros for numeric variables.However, I was looking for &lt;SPAN style="font-size: 13.3333330154419px;"&gt;leading zeros with character variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 14:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214197#M52793</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-13T14:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214198#M52794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My document does show a way to deal with leading zeroes as character variables, you would follow the example shown for the ISBN number example in the beginning of the paper. ISBN does not have leading zeroes, but does show how to specify that Excel treat a number as text. A value like 00023 will still be treated by Excel as a number and until you specify that Excel should treat the number as a character string, it will not be handled correctly. See #1 output below:.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="10385" alt="show_style_override.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10385_show_style_override.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code that produced the above screen shot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** in this data, X is a character variable;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** and Y is a numeric variable;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;data testit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; x='00023';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; y=00098;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; format y z5.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods msoffice2k file='c:\temp\num_as_char.xls' style=htmlblue;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc print data=testit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title '1) default Excel Treatment';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; var x y;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc print data=testit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title '2) With Style Override';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; var x / style(column)={htmlstyle='mso-number-format:\@'};&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; var y / style(column)={htmlstyle='mso-number-format:00000'};&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods msoffice2k close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 21:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214198#M52794</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-05-13T21:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214199#M52795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another workaround.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data testit;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x='00023';_x=cats(x,'09'x);&lt;/P&gt;&lt;P&gt;&amp;nbsp; y=00098;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format y z5.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc export data=testit outfile="c:\temp\country.csv" dbms=csv replace;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 12:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214199#M52795</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-14T12:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214200#M52796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your code. However, I had more than 1 lakh records with leading zeros. So I tried the following code instead of using proc print. However I could not get leading zeros displayed in .xls. May I request you to tell me what is wrong in this code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data testit;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x='00023';&lt;/P&gt;&lt;P&gt;&amp;nbsp; y=00098;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format y z5.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;ods msoffice2k file='/data/num_as_char.xls' style=htmlblue;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=testit nowd;&lt;/P&gt;&lt;P&gt; title '3b) TAGATTR Style Override';&lt;/P&gt;&lt;P&gt; column x y;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define x / display&lt;/P&gt;&lt;P&gt; style(column)={tagattr='Format:@'};&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ods msoffice2k close; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a related point I wish to know to create .csv with leading zeros for the same data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 14:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214200#M52796</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-14T14:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214201#M52797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add a character before it to make CSV take it as a character :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data testit;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; x='00023';&lt;STRONG&gt;_x=cats(x,'09'x);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; y=00098;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; format y z5.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 14:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214201#M52797</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-14T14:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214202#M52798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is '09'x in your cats function?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 08:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214202#M52798</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-15T08:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214203#M52799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A TAB character to make sure EXCEL or CSV take it as a character variable ,not numeric variable .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 12:49:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214203#M52799</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-15T12:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export .csv with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214204#M52800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; One problem with the code you've posted is that when you use ODS MSOFFICE2K, that is an HTML-based destination and you MUST use HTMLSTYLE= as the override, as explained in my paper and shown in my posted code. To use TAGATTR, you have to override the format with TAGSETS.EXCELXP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 14:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export-csv-with-leading-zeros/m-p/214204#M52800</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-05-15T14:15:04Z</dc:date>
    </item>
  </channel>
</rss>

