<?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 Difficulty with SAS time format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209035#M51802</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure what's going on, but I keep trying to convert seconds to time5, and it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am first reading a datetime field from an Oracle passthrough, then taking the timepart, and trying to get it to format as a time5. (For example, I WANT it to display as 23:00 in a report later on, but it is instead displaying as 82800.) However, the time keeps displaying as seconds in the final document. What am I missing in the code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data time_out;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set time_in;&lt;/P&gt;&lt;P&gt;&amp;nbsp; time_fld=timepart(time_fld1);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc datasets library=work;&lt;/P&gt;&lt;P&gt;&amp;nbsp; modify time_out;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format time_fld time5.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried running the time5 format directly in the data step, but it still is displaying the seconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Aug 2015 19:47:42 GMT</pubDate>
    <dc:creator>kgot</dc:creator>
    <dc:date>2015-08-27T19:47:42Z</dc:date>
    <item>
      <title>Difficulty with SAS time format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209035#M51802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure what's going on, but I keep trying to convert seconds to time5, and it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am first reading a datetime field from an Oracle passthrough, then taking the timepart, and trying to get it to format as a time5. (For example, I WANT it to display as 23:00 in a report later on, but it is instead displaying as 82800.) However, the time keeps displaying as seconds in the final document. What am I missing in the code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data time_out;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set time_in;&lt;/P&gt;&lt;P&gt;&amp;nbsp; time_fld=timepart(time_fld1);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc datasets library=work;&lt;/P&gt;&lt;P&gt;&amp;nbsp; modify time_out;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format time_fld time5.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried running the time5 format directly in the data step, but it still is displaying the seconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 19:47:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209035#M51802</guid>
      <dc:creator>kgot</dc:creator>
      <dc:date>2015-08-27T19:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty with SAS time format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209036#M51803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the final document and how does it get there?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 19:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209036#M51803</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-27T19:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty with SAS time format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209037#M51804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is an Excel file that is put together via an ods tagsets.excelxp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 19:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209037#M51804</guid>
      <dc:creator>kgot</dc:creator>
      <dc:date>2015-08-27T19:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty with SAS time format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209038#M51805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think if there is an issue it's a part of the code you're not showing. &lt;/P&gt;&lt;P&gt;Does the following base case work for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;datetime=datetime();&lt;/P&gt;&lt;P&gt;format date: datetime21.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;time=timepart(datetime);&lt;/P&gt;&lt;P&gt;format time time5.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp file="C:\_localdata\delete.xml" style=meadow;&lt;/P&gt;&lt;P&gt;proc print data=want;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp close;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 20:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209038#M51805</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-27T20:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty with SAS time format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209039#M51806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that did display correctly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="table"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;&lt;TD class="r data"&gt;27AUG2015:16:11:05&lt;/TD&gt;&lt;TD class="r data"&gt;16:11&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I can tell, I don't do any further processing to this particular dataset later on, except to join it up to other tables and output this time field. Is there anything else I should look for to troubleshoot?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 20:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209039#M51806</guid>
      <dc:creator>kgot</dc:creator>
      <dc:date>2015-08-27T20:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty with SAS time format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209040#M51807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ACTUALLY, your comment on it being somewhere else in the code made me look elsewhere. I had this data joining to another table in a proc sql, and it must have been reverting back to the seconds then. I put a format in the proc sql, and it worked. Thank you, Reeza!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 20:34:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Difficulty-with-SAS-time-format/m-p/209040#M51807</guid>
      <dc:creator>kgot</dc:creator>
      <dc:date>2015-08-27T20:34:20Z</dc:date>
    </item>
  </channel>
</rss>

