<?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: Write SAS Time fields to Excel - loses time format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751724#M236681</link>
    <description>&lt;P&gt;Thanks, ChrisNZ. However, I already tried the FORMAT statement for the MYTIME variable - that was the first version of my SAS code. However, the results are the same - when I read it back into SAS from Excel, PROC IMPORT sets MYTIME to text. In Excel, the MYTIME cells look OK, but are formatted as "Custom:&amp;nbsp;#######0".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll try a couple other approaches today - PROC REPORT and PROC EXPORT.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2021 13:05:04 GMT</pubDate>
    <dc:creator>bnawrocki</dc:creator>
    <dc:date>2021-07-02T13:05:04Z</dc:date>
    <item>
      <title>Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751568#M236601</link>
      <description>&lt;P&gt;I have a SAS file with field named MYTIME which is Numeric and TIME. format associated. I want to write this to Excel, letting a co-worker edit some other fields, then read back into SAS. Problem is importing back into SAS, MYTIME is assigned TEXT type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To write from SAS to Excel, and make sure format of MYTIME is kept as a time in Excel, I use:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="myfile.xlsx";
   proc print data=mydata;
      var A B C;
      var MYTIME / style(data)={tagattr='format:h:mm'};
   run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I open Excel, it has correctly assigned a format of &lt;STRONG&gt;h:mm&lt;/STRONG&gt; to the MYTIME column, so that looks good, but when I re-import the Excel file into SAS using this code...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import file="myfile.xlsx" dbms=xlsx out=test_read replace; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... MYTIME now is type TEXT with format $8., not NUMERIC with TIME. format!&lt;/P&gt;&lt;P&gt;If I build an Excel file from scratch and enter a time into a cell, it correctly imports to SAS using PROC IMPORT code above, so something different is happening when I create the Excel file via SAS, but what?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 20:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751568#M236601</guid>
      <dc:creator>bnawrocki</dc:creator>
      <dc:date>2021-07-01T20:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751599#M236618</link>
      <description>&lt;P&gt;Try adding&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;format MYTIME time.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;to your proc print.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 00:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751599#M236618</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-02T00:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751724#M236681</link>
      <description>&lt;P&gt;Thanks, ChrisNZ. However, I already tried the FORMAT statement for the MYTIME variable - that was the first version of my SAS code. However, the results are the same - when I read it back into SAS from Excel, PROC IMPORT sets MYTIME to text. In Excel, the MYTIME cells look OK, but are formatted as "Custom:&amp;nbsp;#######0".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll try a couple other approaches today - PROC REPORT and PROC EXPORT.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 13:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751724#M236681</guid>
      <dc:creator>bnawrocki</dc:creator>
      <dc:date>2021-07-02T13:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751843#M236740</link>
      <description>&lt;P&gt;It works fine for me. Try to see what differs between your process and this one:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename XL "myfile.xlsx";
  
ods excel file=XL;
proc print data=SASHELP.CLASS noobs;
  var NAME SEX;
  var AGE / style(data)={tagattr='format:h:mm'};
  format AGE time.;
run;
ods excel close;

proc import file=XL dbms=xlsx out=READ replace; 
proc print data=READ; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;TABLE class="table" style="border-spacing: 0;" aria-label="Data Set WORK.READ"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="header" scope="col"&gt;Name&lt;/TH&gt;
&lt;TH class="header" scope="col"&gt;Sex&lt;/TH&gt;
&lt;TH class="header" scope="col"&gt;Age&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="data"&gt;Alfred&lt;/TD&gt;
&lt;TD class="data"&gt;M&lt;/TD&gt;
&lt;TD class="data"&gt;0:00:14&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="data"&gt;Alice&lt;/TD&gt;
&lt;TD class="data"&gt;F&lt;/TD&gt;
&lt;TD class="data"&gt;0:00:13&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="data"&gt;Barbara&lt;/TD&gt;
&lt;TD class="data"&gt;F&lt;/TD&gt;
&lt;TD class="data"&gt;0:00:13&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Sat, 03 Jul 2021 02:11:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751843#M236740</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-03T02:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751864#M236753</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;Using your code I believe the challenge the OP raises is the data type of Age becoming character instead of numeric.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1625292419354.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60921iECAD69863B61E8FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1625292419354.png" alt="Patrick_0-1625292419354.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 06:07:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751864#M236753</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-03T06:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751880#M236764</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76701"&gt;@bnawrocki&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The trick here is to convert the Time Value to something Excel understands before writing data to Excel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A Time Value is represented in Excel as a fraction of a day, but in SAS it is a number of seconds. So - given the input is a SAS Time Value - the SAS Time Value,should be divided by 86400 (the number of seconds in a day) to get the fraction.&amp;nbsp;Then everything works&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
	a = 1; b=2; c=3;
	textvar = 'anyvalue';
	mytime = '17:28:00't;
	mytime = mytime/86400;
run;

ods excel file="c:\temp\test.xlsx";
   proc print data=mydata;
      var A B C;
      var MYTIME / style(data)={tagattr='format:h:mm'};
   run;
ods excel close;
proc import file="c:\temp\test.xlsx" dbms=xlsx out=test_read replace; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Excel:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t1.gif" style="width: 235px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60924iEE3006E53AD2FB2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="t1.gif" alt="t1.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Import:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t2.gif" style="width: 453px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60925i08F88AD339FFD3B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="t2.gif" alt="t2.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS data set attributes:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t3.gif" style="width: 425px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60926iA1E1A1C1D746745A/image-size/large?v=v2&amp;amp;px=999" role="button" title="t3.gif" alt="t3.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 09:22:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751880#M236764</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-07-03T09:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751909#M236776</link>
      <description>&lt;P&gt;I cannot recreate your issue.&amp;nbsp; Are you using an older version of SAS where ODS EXCEL is experimental?&amp;nbsp; Check the version (including the M# ).&lt;/P&gt;
&lt;PRE&gt;1460  %put &amp;amp;=sysvlong;
SYSVLONG=9.04.01M5P091317
&lt;/PRE&gt;
&lt;P&gt;Did you modify the XLSX file with Excel before trying to read it?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 14:29:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751909#M236776</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-03T14:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751914#M236781</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It doesn't seem to be a version issue.&amp;nbsp;I use&amp;nbsp;SAS&amp;nbsp;9.04.01M7P080520, and I get the same result as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76701"&gt;@bnawrocki&lt;/a&gt;&amp;nbsp;when I run the posted code. The Time variable is imported from the XLSX file as a text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I and I have tried running the code on a Windows X64_10Pro platform and also on a Red Hat Linux version 7.9 with the same result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;152   proc import file="/sasdata/udvk/work/test.xlsx" dbms=xlsx out=test_read replace;
153   run;

NOTE: VARCHAR data type is not supported by the V9 engine. Variable mytime has been converted
      to CHAR data type.
NOTE: The import data set has 1 observations and 5 variables.
NOTE: WORK.TEST_READ data set was successfully created.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 16:04:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751914#M236781</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-07-03T16:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751918#M236785</link>
      <description>&lt;P&gt;Seems to be a bug introduced in 9.4m6.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code works fine in 9.4m5 on both Windows and Unix. But fails in m6 and m7 on Unix.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  do hour=1 to 5 ;
    time=hour*60*60 ;
    output;
  end;
  format time time8.;
run;

%let fname=%sysfunc(pathname(work))/example1.xlsx;

ods excel file="&amp;amp;fname" options (sheet_name='Sheet1');
proc print data=test noobs;
 var hour;
 var time / style(data)={tagattr='format:h:mm'};
run;
ods excel close ;

libname x xlsx "&amp;amp;fname";

proc contents data=x._all_;
run;

proc import file="&amp;amp;fname" dbms=xlsx out=test_read replace;
run;

proc contents data=test_read ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;PRE&gt;&amp;gt;grep time m?.lst
m5.lst:hour        time
m5.lst:     Obs    hour     time
m5.lst:2    time        Num       8    TIME.     time 
m5.lst:2    time        Num       8    TIME.     time 
m6.lst:hour        time
m6.lst:     Obs    hour    time
m6.lst:2    time        Char      7    $7.       $7.         time 
m6.lst:2    time        Char      7    $7.       $7.         time 
m7.lst:hour        time
m7.lst:     Obs    hour    time
m7.lst:2    time        Char      7    $7.       $7.         time 
m7.lst:2    time        Char      7    $7.       $7.         time 
&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Jul 2021 16:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751918#M236785</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-03T16:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751935#M236791</link>
      <description>&lt;P&gt;It also fails for Windows 9.4M7 workstation&lt;/P&gt;
&lt;PRE&gt;Current version: 9.04.01M7P080520
Operating System:   WX64_WKS.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 03:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751935#M236791</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-04T03:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751955#M236801</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76701"&gt;@bnawrocki&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I couldn't find any SAS or defect Note for this issue so raised a SAS TechSupport track. I'll post proceedings here once received.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 08:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751955#M236801</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-04T08:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751960#M236806</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76701"&gt;@bnawrocki&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a workaround so you can get your code working in M7 (Win and Linux) while you wait for a hotfix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added a step to Tom's code to convert the SAS time to an Excel time and remove the TIME Format from the variable. Then it works.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  do hour=1 to 5 ;
    time=hour*60*60 ;
    output;
  end;
  format time time8.;
run;

* Step added to fix problem; 
* Format statement placed before Set statement to remove the existing time format;
data test; 
	format time 8.;
	set test;
	time = time/86400;
run;

%let fname=%sysfunc(pathname(work))/example1.xlsx;

ods excel file="&amp;amp;fname" options (sheet_name='Sheet1');
proc print data=test noobs;
 var hour;
 var time / style(data)={tagattr='format:h:mm'};
run;
ods excel close ;

libname x xlsx "&amp;amp;fname";

proc contents data=x._all_;
run;

proc import file="&amp;amp;fname" dbms=xlsx out=test_read replace;
run;

proc contents data=test_read ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- And I am aware that using the same data set as input and output isn't best practice, but I took the liberty here to avoid making any changes in Tom's code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 09:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/751960#M236806</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-07-04T09:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/752010#M236821</link>
      <description>&lt;P&gt;9.2M2 on Windows here. I obtain different results.&lt;/P&gt;
&lt;P&gt;The variable is never seen as a string, but is imported as number of hours instead of number of minutes if the time format is not applied.&lt;/P&gt;
&lt;P&gt;That's because the custom Excel format strips the seconds.&lt;/P&gt;
&lt;P&gt;When the format is applied, all works as expected (hence my suggestion earlier). Successive versions seem to behave differently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="&amp;amp;wdir\myfile.xlsx";
   proc print data=SASHELP.CLASS(obs=3) noobs;
      var NAME SEX;         
      format AGE time.;
      var AGE / style(data)={tagattr='format:hh:mm'};
   run;
ods excel close;
proc import file="&amp;amp;wdir\myfile.xlsx" dbms=xlsx out=T replace; run;
proc print; run;
proc contents; run;

ods excel file="&amp;amp;wdir\myfile.xlsx";
   proc print data=SASHELP.CLASS(obs=3) noobs;
      var NAME SEX;         
      * format AGE time.;  ******************************* format commented out; 
      var AGE / style(data)={tagattr='format:hh:mm'};
   run;
ods excel close;
proc import file="&amp;amp;wdir\myfile.xlsx" dbms=xlsx out=T replace; run;
proc print; run;
proc contents; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set SASHELP.CLASS" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l header" scope="col"&gt;Name&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Sex&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Age&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;Joyce&lt;/TD&gt;
&lt;TD class="l data"&gt;F&lt;/TD&gt;
&lt;TD class="r data"&gt;0:00:11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;Thomas&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;0:00:11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;James&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;0:00:12&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.T" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Name&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Sex&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Age&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Joyce&lt;/TD&gt;
&lt;TD class="l data"&gt;F&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0:00:11&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Thomas&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0:00:11&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;James&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0:00:12&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Contents: Engine/Host Information" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="2" scope="colgroup"&gt;Engine/Host Dependent Information&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Data Set Page Size&lt;/TH&gt;
&lt;TD class="l data"&gt;131072&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of Data Set Pages&lt;/TH&gt;
&lt;TD class="l data"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of Data Set Repairs&lt;/TH&gt;
&lt;TD class="l data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Filename&lt;/TH&gt;
&lt;TD class="l data"&gt;K:\SASWORK\_TD9924_NZ8037SPSAS2003_\Prc2\t.sas7bdat&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Release Created&lt;/TH&gt;
&lt;TD class="l data"&gt;9.0401M2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Host Created&lt;/TH&gt;
&lt;TD class="l data"&gt;X64_SRV12&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Contents: Variables" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="7" scope="colgroup"&gt;Alphabetic List of Variables and Attributes&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;#&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Type&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Len&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Format&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Informat&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Label&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Age&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Num&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;8&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;TIME.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Age&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Name&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="l data"&gt;$6.&lt;/TD&gt;
&lt;TD class="l data"&gt;$6.&lt;/TD&gt;
&lt;TD class="l data"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Sex&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;Sex&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR size="3" /&gt;&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set SASHELP.CLASS" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l header" scope="col"&gt;Name&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Sex&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Age&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;Joyce&lt;/TD&gt;
&lt;TD class="l data"&gt;F&lt;/TD&gt;
&lt;TD class="r data"&gt;11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;Thomas&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;James&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.T" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Name&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Sex&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Age&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Joyce&lt;/TD&gt;
&lt;TD class="l data"&gt;F&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;264:00&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Thomas&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;264:00&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;James&lt;/TD&gt;
&lt;TD class="l data"&gt;M&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;288:00&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Contents: Engine/Host Information" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="2" scope="colgroup"&gt;Engine/Host Dependent Information&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Data Set Page Size&lt;/TH&gt;
&lt;TD class="l data"&gt;131072&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of Data Set Pages&lt;/TH&gt;
&lt;TD class="l data"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of Data Set Repairs&lt;/TH&gt;
&lt;TD class="l data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Filename&lt;/TH&gt;
&lt;TD class="l data"&gt;K:\SASWORK\_TD9924_NZ8037SPSAS2003_\Prc2\t.sas7bdat&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Release Created&lt;/TH&gt;
&lt;TD class="l data"&gt;9.0401M2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Host Created&lt;/TH&gt;
&lt;TD class="l data"&gt;X64_SRV12&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Contents: Variables" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="7" scope="colgroup"&gt;Alphabetic List of Variables and Attributes&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;#&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Type&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Len&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Format&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Informat&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Label&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TH&gt;
&lt;TD class="l data"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Age&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Num&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;TIME.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Age&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Name&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="l data"&gt;$6.&lt;/TD&gt;
&lt;TD class="l data"&gt;$6.&lt;/TD&gt;
&lt;TD class="l data"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Sex&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;Sex&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 02:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/752010#M236821</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-05T02:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/753255#M237382</link>
      <description>&lt;P&gt;A hearty thank you to everyone who has responded to my question. The workaround code (see Accepted Solution) is working for me, so I'm happy!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 18:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/753255#M237382</guid>
      <dc:creator>bnawrocki</dc:creator>
      <dc:date>2021-07-09T18:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/753275#M237385</link>
      <description>&lt;P&gt;Spoke a bit too soon.&lt;/P&gt;&lt;P&gt;SAS still isn't reading a TIME column back in as a Numeric time value if any of the values in that TIME column are missing (blank). It assigns the entire column as Text. I'll try a few more output options...&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 19:19:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/753275#M237385</guid>
      <dc:creator>bnawrocki</dc:creator>
      <dc:date>2021-07-09T19:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/753281#M237386</link>
      <description>&lt;P&gt;Got around the missing TIME values by adding this code to force a 00:00 time value into the field if the time is missing, before writing it to Excel. That field now correctly IMPORTs from Excel back into SAS as a Time field.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if missing(MYTIME) then MYTIME= '0:0't;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jul 2021 20:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/753281#M237386</guid>
      <dc:creator>bnawrocki</dc:creator>
      <dc:date>2021-07-09T20:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Write SAS Time fields to Excel - loses time format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/753414#M237443</link>
      <description>&lt;P&gt;Just as an update: This issue has now been raised with SAS R&amp;amp;D.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 02:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-SAS-Time-fields-to-Excel-loses-time-format/m-p/753414#M237443</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-12T02:51:32Z</dc:date>
    </item>
  </channel>
</rss>

