<?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: ods msoffice2k-Leading zeros in output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ods-msoffice2k-Leading-zeros-in-output/m-p/511317#M137581</link>
    <description>&lt;P&gt;First of all: don't lie with your filename extension. ODS MSOFFICE2K creates HTML, so the file should have an extension of .html or .htm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you look at the file, you'll see that you get a HTML TABLE object. HTML TABLE cells do not have a type, so Excel has to guess what it is. 06555 looks like a number, Excel stores it as such, and uses the default number format which suppresses leading zeroes. The only things that are recognized are the alignment (because that's part of the HTML TABLE cell formatting), and the mso-number-format style property.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Nov 2018 08:31:35 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-11-08T08:31:35Z</dc:date>
    <item>
      <title>ods msoffice2k-Leading zeros in output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-msoffice2k-Leading-zeros-in-output/m-p/511312#M137579</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In following code the data in excel doesn't includes leading zeros.&lt;/P&gt;
&lt;P&gt;What is the way to solve it?&lt;/P&gt;
&lt;P&gt;Why option leading_zero="yes" &amp;nbsp;is not working?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
retain zip account;
set sashelp.class;
zip="06555";
account="0345";
run;
ods msoffice2k path="path" (url=none)
         gpath="pathr" (url=none)
         file="file4b.xls"
		 options( leading_zero="yes")
         style=normal;
  proc print data=one noobs;
  Title;
  var zip account;
  var age height / style(data)={htmlstyle="mso-number-format:'##.00'"};
  var weight;
  run;
ods msoffice2k close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Nov 2018 07:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-msoffice2k-Leading-zeros-in-output/m-p/511312#M137579</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-11-08T07:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: ods msoffice2k-Leading zeros in output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-msoffice2k-Leading-zeros-in-output/m-p/511317#M137581</link>
      <description>&lt;P&gt;First of all: don't lie with your filename extension. ODS MSOFFICE2K creates HTML, so the file should have an extension of .html or .htm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you look at the file, you'll see that you get a HTML TABLE object. HTML TABLE cells do not have a type, so Excel has to guess what it is. 06555 looks like a number, Excel stores it as such, and uses the default number format which suppresses leading zeroes. The only things that are recognized are the alignment (because that's part of the HTML TABLE cell formatting), and the mso-number-format style property.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 08:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-msoffice2k-Leading-zeros-in-output/m-p/511317#M137581</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-08T08:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: ods msoffice2k-Leading zeros in output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-msoffice2k-Leading-zeros-in-output/m-p/511322#M137583</link>
      <description>&lt;P&gt;Stop mixing file types and old syntax.&amp;nbsp; If you want to create an&amp;nbsp;&lt;STRONG&gt;actual&lt;/STRONG&gt; Excel file for the modern day, then it will be an XLSX formatted file created using ods Excel.&amp;nbsp; What you are creating there is HTML.&amp;nbsp; Then you are calling it XLS, which it is not, and you wouldn't want an old file format like XLS which is proprietary binary file replaced now by the Open Office file format such as XLSX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ods excel:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings17/0169-2017.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings17/0169-2017.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't have the latest SAS version (and the question then is why not?), then use ods tagsets.excelxp.&amp;nbsp; This creates XML output which Excel can parse:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings17/0973-2017.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings17/0973-2017.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That doesn't create native files though, just xml which is not ideal, but does have a lot of formatting options.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 08:58:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-msoffice2k-Leading-zeros-in-output/m-p/511322#M137583</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-08T08:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: ods msoffice2k-Leading zeros in output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-msoffice2k-Leading-zeros-in-output/m-p/511326#M137585</link>
      <description>I think the loss of leading zero is an excel formatting issue&lt;BR /&gt;Instead of&lt;BR /&gt;"##.00'"&lt;BR /&gt;Try&lt;BR /&gt;"00.00"&lt;BR /&gt;Practise in excel choosing different "custom" number formats</description>
      <pubDate>Thu, 08 Nov 2018 09:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-msoffice2k-Leading-zeros-in-output/m-p/511326#M137585</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2018-11-08T09:06:16Z</dc:date>
    </item>
  </channel>
</rss>

