<?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: How to transfer SAS time to Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689233#M209507</link>
    <description>&lt;P&gt;I'm currently using a data step to save the SAS table in a folder on the server. And then using the SAS Add-In to connect that SAS table to a pivot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use PROC EXPORT to save the table as a CSV (as the file size exceeds Excel's row limit), Excel is now treating it as a datetime variable but I am not getting an accurate count of hh:mm:ss in the pivot table still.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Oct 2020 15:38:53 GMT</pubDate>
    <dc:creator>BlayLay</dc:creator>
    <dc:date>2020-10-06T15:38:53Z</dc:date>
    <item>
      <title>How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689209#M209491</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Today's challenge is that I'm bringing in "Production Time" from SAS (formatted as hh:mm:ss $8.) to excel. I was advised that you should bring in time. into excel as character strings, so I did that in SAS before connecting the data to excel. It displays correctly if I look at a subset of the data, however, the entire file is so large that I need to make a SAS connection via a pivot table. This is where the issue begins. When I create the pivot in excel, sum of production by date, I format the Prod Time variable as [h]:mm:ss to get my desired view but it for some reason shows blank in the pivot. Here's a mockup table for an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Row Labels&lt;/TD&gt;&lt;TD&gt;Sum of Prod Time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/1/2020&lt;/TD&gt;&lt;TD&gt;0:00:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/2/2020&lt;/TD&gt;&lt;TD&gt;0:00:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/3/2020&lt;/TD&gt;&lt;TD&gt;0:00:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried "Count of Prod Time" and that ends up showing hundreds of hours with 0 minutes and 0 seconds (which isn't accurate, since one day should be around 8 hours).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has any suggestions I would greatly appreciate it. If this isn't the right forum, please advise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 13:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689209#M209491</guid>
      <dc:creator>BlayLay</dc:creator>
      <dc:date>2020-10-06T13:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689212#M209494</link>
      <description>&lt;P&gt;PROC EXPORT or LIBNAME XLSX will convert SAS time values (numeric, count of seconds, TIME format) to Excel time values.&lt;/P&gt;
&lt;P&gt;Time values formatted as HH:MM:SS in a CSV file will also be recognized by Excel as a time value.&lt;/P&gt;
&lt;P&gt;How do you export your SAS data to Excel (code)?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 13:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689212#M209494</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-06T13:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689233#M209507</link>
      <description>&lt;P&gt;I'm currently using a data step to save the SAS table in a folder on the server. And then using the SAS Add-In to connect that SAS table to a pivot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use PROC EXPORT to save the table as a CSV (as the file size exceeds Excel's row limit), Excel is now treating it as a datetime variable but I am not getting an accurate count of hh:mm:ss in the pivot table still.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 15:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689233#M209507</guid>
      <dc:creator>BlayLay</dc:creator>
      <dc:date>2020-10-06T15:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689249#M209514</link>
      <description>&lt;P&gt;If you make sure that your time values are stored as such in SAS (not as $8 strings), then the AddIn should get them right in Excel.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 15:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689249#M209514</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-06T15:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689258#M209517</link>
      <description>&lt;P&gt;The time values are stored as Numeric Time. in SAS and show correctly in excel when I subset the data, however, when I try to use a pivot to find the sum of hours on a particular day it's still giving me hundreds of hours (996:00:00) when it should be approximately 8 hours worth (08:00:00). And not allowing me to "sum" because it's a date. Only allows me to "count".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally, when i click into the value in the pivot table, it's treating it as a datetime (2/9/1900 12:00:00 AM) even though I've formatted it as HH:MM:SS in the value field settings.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 16:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689258#M209517</guid>
      <dc:creator>BlayLay</dc:creator>
      <dc:date>2020-10-06T16:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689261#M209519</link>
      <description>&lt;P&gt;In Excel, time, date and datetime share the same basic layout. Dates are counts of days, times are fractions of days (12:00:00 is therefore 0.5), and datetimes are counts of days with fractions added. I have no idea why Excel does not let you sum times.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 16:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689261#M209519</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-06T16:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689263#M209520</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/349857"&gt;@BlayLay&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm currently using a data step to save the SAS table in a folder on the server. And then using the SAS Add-In to connect that SAS table to a pivot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use PROC EXPORT to save the table as a CSV (as the file size &lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;STRONG&gt;exceeds Excel's row limit&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;), Excel is now treating it as a datetime variable but I am not getting an accurate count of hh:mm:ss in the pivot table still.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the data exceeds Excel's row limit then are you sure you should be using Excel at all?? Even with the SAS Add-in I would suspect that the pivot can't use all of the data.(and have performance issues besides).&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 16:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689263#M209520</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-06T16:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689267#M209523</link>
      <description>&lt;P&gt;Unfortunately, for my business partner, Excel is the only option to display the desired dashboard. As I mentioned, when I pull a subset of the data onto a sheet, the duration hh:mm:ss are formatted correctly and I even pivoted that subset and was able to sum correctly. However, when I make a pivot to an external connection (the mentioned CSV) the pivot table does not allow me to sum the duration variable.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 16:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689267#M209523</guid>
      <dc:creator>BlayLay</dc:creator>
      <dc:date>2020-10-06T16:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689374#M209559</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/349857"&gt;@BlayLay&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Unfortunately, for my business partner, Excel is the only option to display the desired dashboard. As I mentioned, when I pull a subset of the data onto a sheet, the duration hh:mm:ss are formatted correctly and I even pivoted that subset and was able to sum correctly. However, when I make a pivot to an external connection (the mentioned CSV) the pivot table does not allow me to sum the duration variable.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sounds like you need to ask this question on an Excel forum.&lt;/P&gt;
&lt;P&gt;What the heck is an "external connection" in Excel?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 23:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689374#M209559</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-10-06T23:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to transfer SAS time to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689375#M209560</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/349857"&gt;@BlayLay&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm currently using a data step to save the SAS table in a folder on the server. And then using the SAS Add-In to connect that SAS table to a pivot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use PROC EXPORT to save the table as a CSV (as the file size exceeds Excel's row limit), Excel is now treating it as a datetime variable but I am not getting an accurate count of hh:mm:ss in the pivot table still.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try removing the TIME format from the variable. That way when you write it to the CSV file it will just be the number of seconds instead a string with colons in it.&amp;nbsp; If you want it to look like hours then divide by 60*60, either before or after summing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;345   data test;
346     input duration :time. @@;
347     seconds = duration;
348     minutes = seconds/60;
349     hours = minutes/60;
350     format duration tod8. ;
351     put (_all_) (=);
352   cards;

duration=05:00:00 seconds=18000 minutes=300 hours=5
duration=12:30:00 seconds=45000 minutes=750 hours=12.5
&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Oct 2020 23:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transfer-SAS-time-to-Excel/m-p/689375#M209560</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-10-06T23:48:39Z</dc:date>
    </item>
  </channel>
</rss>

