<?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: Export to Excel - Number of hours rather than time of day in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634681#M188394</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/62592"&gt;@robulon&lt;/a&gt;&amp;nbsp; Styles let you change the format Excel uses.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
  format hours time.;
  do hours='11:00't to '28:00't by 2999;
    output;
  end;
  stop;
run;

options missing=' ';
ods listing close;
ods excel file='~/test/sample.xlsx';
proc print data=sample noobs;
  var hours / style(column)={tagattr='format: [h]:mm:ss'};
run;
ods excel close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1585132563763.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37343i60E7935732064345/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1585132563763.png" alt="Patrick_0-1585132563763.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2020 10:36:56 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2020-03-25T10:36:56Z</dc:date>
    <item>
      <title>Export to Excel - Number of hours rather than time of day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634657#M188383</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a bit stuck here and haven't been able to track a solution down so hoping for a bit of assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written some sas code that uses proc sql to sum up telephone call times and produces a total number of hours, minutes and seconds that a team has completed each day. I have applied the time. format so get, for example, for one day I get a total of 40:34:15 which is great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem comes when I look to export the report to Excel for distribution. Excel seems to be automatically applying a time of day format, so for the above example, it is displaying 16:34:15.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone suggest a way around this? Ideally I just want to be able to run the code and be in a position to send out the excel report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Rob&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 09:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634657#M188383</guid>
      <dc:creator>robulon</dc:creator>
      <dc:date>2020-03-25T09:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel - Number of hours rather than time of day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634665#M188387</link>
      <description>&lt;P&gt;I've managed to sort this, I've used put to create the time variables as character and they are exporting into the Excel sheet as required: -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;put(round(sum(talk),1),time.) as total_time&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634665#M188387</guid>
      <dc:creator>robulon</dc:creator>
      <dc:date>2020-03-25T10:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel - Number of hours rather than time of day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634667#M188388</link>
      <description>&lt;P&gt;The Excel format that displays such a value correctly is&lt;/P&gt;
&lt;PRE&gt;[h]:mm:ss&lt;/PRE&gt;
&lt;P&gt;How do you export the report to Excel?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634667#M188388</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-25T10:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel - Number of hours rather than time of day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634668#M188389</link>
      <description>Not sure if it's forum etiquette to mark your own solution but there you go</description>
      <pubDate>Wed, 25 Mar 2020 10:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634668#M188389</guid>
      <dc:creator>robulon</dc:creator>
      <dc:date>2020-03-25T10:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel - Number of hours rather than time of day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634671#M188390</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/62592"&gt;@robulon&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Not sure if it's forum etiquette to mark your own solution but there you go&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's OK, as it points any other who views the thread to something that worked. And it was&amp;nbsp;&lt;EM&gt;you&lt;/EM&gt; who found a viable solution.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634671#M188390</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-25T10:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel - Number of hours rather than time of day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634677#M188392</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am writing to a named range in the Excel sheet. When I opened the Excel sheet the data in the cell just showed as 16:34:15, however if I typed in the 40:34:15 and applied the [h]:mm:ss format, it showed the correct figure, so the issue seemed to be in how Excel was interpreting the data I was trying to write into it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634677#M188392</guid>
      <dc:creator>robulon</dc:creator>
      <dc:date>2020-03-25T10:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel - Number of hours rather than time of day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634681#M188394</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/62592"&gt;@robulon&lt;/a&gt;&amp;nbsp; Styles let you change the format Excel uses.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
  format hours time.;
  do hours='11:00't to '28:00't by 2999;
    output;
  end;
  stop;
run;

options missing=' ';
ods listing close;
ods excel file='~/test/sample.xlsx';
proc print data=sample noobs;
  var hours / style(column)={tagattr='format: [h]:mm:ss'};
run;
ods excel close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1585132563763.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37343i60E7935732064345/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1585132563763.png" alt="Patrick_0-1585132563763.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:36:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Excel-Number-of-hours-rather-than-time-of-day/m-p/634681#M188394</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-25T10:36:56Z</dc:date>
    </item>
  </channel>
</rss>

