<?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: Calculating Difference in HH:MM:SS time using INTCK in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-Difference-in-HH-MM-SS-time-using-INTCK/m-p/180095#M45926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the values are true SAS datetime values, then the duration is simply the subtraction of the End minus Start times. This is the duration in seconds. INTCK is not needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to present this number of seconds as HH:MM:SS, you could use the proper format, which is the TIMEw.d format&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Feb 2015 16:07:33 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2015-02-24T16:07:33Z</dc:date>
    <item>
      <title>Calculating Difference in HH:MM:SS time using INTCK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-Difference-in-HH-MM-SS-time-using-INTCK/m-p/180094#M45925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi! I am EXTREMELY wet behind the ears in SAS.&amp;nbsp; I have data of medical providers and how long they recorded temperatures in their vaccine storage units. The amount of time that these providers were recording temperatures in their refrigerators and freezers is presented in a DATE/HH:MM format. I need to create a new variable (duration), that subtracts the End time from the Start time to determine the total time they were recording. The data in my new duration variable should be presented in HH:MM:SS format. I will need to manipulate the HH:MM:SS data in the duration column in different ways by provider, so I need SAS to continue to recognize it in this format and add them correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Date/Time Start&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Date/Time End&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;(New Variable) Duration&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;10/31/13 10:27&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10/31/13 15:27&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5:00:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;9/27/13 9:15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9/28/13 12:00&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;26:45:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;9/28/13 12:15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9/28/13 13:15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1:00:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;10/1/13 8:01&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10/1/13 8:36&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;00:30:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Need to be able to add Duration correctly - 33:15:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I found the following INTCK statements that seem as though they may be on the right track of giving me what I need, however, the statements split out the hours/minutes/seconds. It doesn't give me the duration in the hh:mm:ss format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;Datetime arguments:&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;hours=intck ('hour' , '01jan2009:00:00:00'dt, '01jan2010:00:00:00'dt);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;minutes=intck ('minute' , '01jan2009:00:00:00'dt, '01jan2010:00:00:00'dt);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;seconds=intck ('second', '01jan2009:00:00:00'dt, '01jan2010:00:00:00'dt);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result values will be:&lt;/P&gt;&lt;P&gt;*hours = 8760&lt;/P&gt;&lt;P&gt;*minutes = 525600&lt;/P&gt;&lt;P&gt;*seconds = 31536000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 15:58:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-Difference-in-HH-MM-SS-time-using-INTCK/m-p/180094#M45925</guid>
      <dc:creator>ebonyw</dc:creator>
      <dc:date>2015-02-24T15:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Difference in HH:MM:SS time using INTCK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-Difference-in-HH-MM-SS-time-using-INTCK/m-p/180095#M45926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the values are true SAS datetime values, then the duration is simply the subtraction of the End minus Start times. This is the duration in seconds. INTCK is not needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to present this number of seconds as HH:MM:SS, you could use the proper format, which is the TIMEw.d format&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 16:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-Difference-in-HH-MM-SS-time-using-INTCK/m-p/180095#M45926</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-02-24T16:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Difference in HH:MM:SS time using INTCK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-Difference-in-HH-MM-SS-time-using-INTCK/m-p/180096#M45927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much, Paige! I'm not sure if my values were true SAS datetime values. I will go look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 16:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-Difference-in-HH-MM-SS-time-using-INTCK/m-p/180096#M45927</guid>
      <dc:creator>ebonyw</dc:creator>
      <dc:date>2015-02-24T16:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Difference in HH:MM:SS time using INTCK</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-Difference-in-HH-MM-SS-time-using-INTCK/m-p/180097#M45928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If they are not datetime values (for example they are characters), then you should convert them to datetime, that would be the easiest path forward.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 18:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-Difference-in-HH-MM-SS-time-using-INTCK/m-p/180097#M45928</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-02-24T18:06:49Z</dc:date>
    </item>
  </channel>
</rss>

