<?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 Excel - DATETIME values not displaying properly in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426154#M20133</link>
    <description>&lt;P&gt;I'm 9.4 M3 and all of those examples worked fine, the date showed up exactly as it was shown in the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Were you looking for something else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS 9.4 TS1M3, Windows 7, Office 2010&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jan 2018 16:26:42 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-01-09T16:26:42Z</dc:date>
    <item>
      <title>ODS Excel - DATETIME values not displaying properly</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426010#M20119</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The thread below suggests that the issue of datetime values formatted as General when using ODS Excel would be addressed in the M3 patch. However, I'm encountering the issue on a server patched to M4, so is it still a problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Server version: 9.04.01M4P110916&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Write-DATETIME-values-to-ODS-EXCEL/m-p/205533/highlight/true#M13639" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Write-DATETIME-values-to-ODS-EXCEL/m-p/205533/highlight/true#M13639&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
	picture dtspec 
		. = ' '
 		other='%0d/%0m/%Y %0H:%0M:%0S' (datatype=datetime );
	;
run;

data date_test(keep=testdate); 
	format testdate dtspec.;
	testdate='01JAN2018 08:36:09'dt;	
run;

ods listing close;
ods excel file="/&amp;lt;path&amp;gt;/testdates.xlsx";

proc report data = date_test;
	title j=l "Test";
	column 	testdate;
	define testdate	/  style(column)={tagattr='format:dd/mm/yy;@'} group left;
run;
ods excel close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Much like&amp;nbsp;the OP above, editing the cell with F2 and pressing enter forces the format to resolve, but it initially displays as General. Any suggestions at all would be welcome. I'd like to use ODS Excel over ExcelXP purely for its native support of the XLSX file type (removes the need for a conversion script after each ODS step)/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 10:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426010#M20119</guid>
      <dc:creator>DingoChutney</dc:creator>
      <dc:date>2018-01-09T10:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - DATETIME values not displaying properly</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426045#M20124</link>
      <description>&lt;P&gt;Not sure if it could work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; style(column)={tagattr='format:dd/mm/yy;@  type:datetime '}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jan 2018 12:19:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426045#M20124</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-09T12:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - DATETIME values not displaying properly</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426073#M20129</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Not sure if it could work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; style(column)={tagattr='format:dd/mm/yy;@  type:datetime '}&lt;/CODE&gt;&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi there, cheers for replying. I'm afraid I'd tried it with and without the type clause. No difference!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 13:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426073#M20129</guid>
      <dc:creator>DingoChutney</dc:creator>
      <dc:date>2018-01-09T13:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - DATETIME values not displaying properly</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426152#M20132</link>
      <description>&lt;P&gt;Try having both the&amp;nbsp;SAS format and the tagattr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define testdate	/  format = dtspec. style(column)={tagattr='format:dd/mm/yy;@'} group left;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jan 2018 16:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426152#M20132</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-09T16:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - DATETIME values not displaying properly</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426154#M20133</link>
      <description>&lt;P&gt;I'm 9.4 M3 and all of those examples worked fine, the date showed up exactly as it was shown in the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Were you looking for something else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS 9.4 TS1M3, Windows 7, Office 2010&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 16:26:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426154#M20133</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-09T16:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - DATETIME values not displaying properly</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426362#M20141</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;I'm 9.4 M3 and all of those examples worked fine, the date showed up exactly as it was shown in the code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Were you looking for something else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS 9.4 TS1M3, Windows 7, Office 2010&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;None of them work for me, so I'm wondering if there's something else amiss? This is being executed on Linux, perhaps whatever fix was introduced in M3 on Windows hasn't yet been applied on other OSs? Or maybe it's an Excel issue? I'm stumped to be honest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your suggestions though!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 10:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426362#M20141</guid>
      <dc:creator>DingoChutney</dc:creator>
      <dc:date>2018-01-10T10:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - DATETIME values not displaying properly</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426378#M20142</link>
      <description>&lt;P&gt;I did some more testing. Dates work fine - no tagattr clause needed, just a properly formatted SAS date. Also, converting the datetime to an excel numeric representation of a datetime works - I used tagattr and set the type as Number with a date format. See below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
	picture dtspec 
		. = ' '
 		other='%0d/%0m/%Y %0H:%0M:%0S' (datatype=datetime );
	;
run;

data date_test(keep=test:); 
	format testdatetime dtspec. testdate ddmmyy10.;
	testdatetime='01JAN2018 08:36:09'dt;	
	testdate = today();
	testxldate = 43101.3723263889;
run;

ods listing close;
ods excel file="/&amp;lt;path&amp;gt;/testdates.xlsx";

proc report data = date_test;
	title j=l "Test";
	column 	testdate testdatetime testxldate;
	define testdate	/ display;
	define testdatetime	/ style(column)={tagattr='type:Date format:dd/mm/yy;'} display;
	define testxldate	/ style(column)={tagattr='type:Number format:dd/mm/yy;'} display;
run;
ods excel close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jan 2018 11:26:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-DATETIME-values-not-displaying-properly/m-p/426378#M20142</guid>
      <dc:creator>DingoChutney</dc:creator>
      <dc:date>2018-01-10T11:26:30Z</dc:date>
    </item>
  </channel>
</rss>

