<?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 Format Excel date as dd/mm/yyyy in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-Excel-date-as-dd-mm-yyyy/m-p/386805#M19019</link>
    <description>&lt;P&gt;I have 3 datetimes in my dataset in the following format:&amp;nbsp;02AUG2017:07:39:00.000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to output them to Excel through ODS using a format 08/02/2017.&amp;nbsp; I have tried several date formats&amp;nbsp;but haven't been succesfful. &amp;nbsp;What am I missing?&lt;/P&gt;&lt;PRE&gt;ods EXCEL file="\\networkpath_&amp;amp;SYSDATE..xlsx" ; 

ods EXCEL options(sheet_name='Negative Margin Audit');
proc print data=work.AP_Audit_NegMgn3

style (header) = {background=cyan}
style (grandtotal) = {background=cyan} LABEL;
format order_margin movement_margin total_charge Carrier_Pay Carrier_Extra_Pay Carrier_Total_Pay dollar10.2;
format Delivery_Date ddmmyys10.;
sum order_margin;
sum movement_margin;
sum total_charge;
sum carrier_pay;
sum carrier_extra_pay;
sum carrier_total_pay;
run;

ods EXCEL close;&lt;/PRE&gt;</description>
    <pubDate>Wed, 09 Aug 2017 21:03:13 GMT</pubDate>
    <dc:creator>labin</dc:creator>
    <dc:date>2017-08-09T21:03:13Z</dc:date>
    <item>
      <title>Format Excel date as dd/mm/yyyy</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-Excel-date-as-dd-mm-yyyy/m-p/386805#M19019</link>
      <description>&lt;P&gt;I have 3 datetimes in my dataset in the following format:&amp;nbsp;02AUG2017:07:39:00.000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to output them to Excel through ODS using a format 08/02/2017.&amp;nbsp; I have tried several date formats&amp;nbsp;but haven't been succesfful. &amp;nbsp;What am I missing?&lt;/P&gt;&lt;PRE&gt;ods EXCEL file="\\networkpath_&amp;amp;SYSDATE..xlsx" ; 

ods EXCEL options(sheet_name='Negative Margin Audit');
proc print data=work.AP_Audit_NegMgn3

style (header) = {background=cyan}
style (grandtotal) = {background=cyan} LABEL;
format order_margin movement_margin total_charge Carrier_Pay Carrier_Extra_Pay Carrier_Total_Pay dollar10.2;
format Delivery_Date ddmmyys10.;
sum order_margin;
sum movement_margin;
sum total_charge;
sum carrier_pay;
sum carrier_extra_pay;
sum carrier_total_pay;
run;

ods EXCEL close;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Aug 2017 21:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-Excel-date-as-dd-mm-yyyy/m-p/386805#M19019</guid>
      <dc:creator>labin</dc:creator>
      <dc:date>2017-08-09T21:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Format Excel date as dd/mm/yyyy</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-Excel-date-as-dd-mm-yyyy/m-p/386808#M19020</link>
      <description>&lt;P&gt;There are three basic approaches. The first is to realize that you have a DATETIME value and DATE formats do not work as datetime is measured in seconds and dates in days.&lt;/P&gt;
&lt;P&gt;Easiest if you are willing to accept values like 02AUG2017 is to use the datetime format DTDATE9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second would be to create a custom format to show the date pieces of a datetime value. If you are going to do this, display datetimes in an mmddyy10 format (not ddmmyy which would show 2 aug as 02/08/2017), frequently might be the way to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Third is to create an actual date value in your data set. If you don't use the time portion for anything then in a data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Delivery_date = datepart(Delivery_date);&lt;/P&gt;
&lt;P&gt;If you need to keep the datetime value then create a new variable:&lt;/P&gt;
&lt;P&gt;D_date = datepart(Delivery_date);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then use the mmddyys10. format with the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 21:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-Excel-date-as-dd-mm-yyyy/m-p/386808#M19020</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-09T21:15:05Z</dc:date>
    </item>
  </channel>
</rss>

