<?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 How to calculate datetime difference between two date values in minutes and hours in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-calculate-datetime-difference-between-two-date-values-in/m-p/234424#M5905</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I need help (SAS code) in calculating difference in minutes and hours for datetime variables. I have attached a copy of my data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I have several Reg_Nos and the corresponding culture_dates (datetime). Some of the Reg_nos have multiple culture_date which are in different row compared to the first culture_date for that Reg_no (eg. I have highlighted in red).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to find the difference in minutes and hours from the first culture_date to the next cultre_date if a Reg_No has more than one culture_date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help!&lt;/P&gt;
&lt;P&gt;Satish&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2015 17:57:29 GMT</pubDate>
    <dc:creator>smunigala</dc:creator>
    <dc:date>2015-11-12T17:57:29Z</dc:date>
    <item>
      <title>How to calculate datetime difference between two date values in minutes and hours</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-calculate-datetime-difference-between-two-date-values-in/m-p/234424#M5905</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I need help (SAS code) in calculating difference in minutes and hours for datetime variables. I have attached a copy of my data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I have several Reg_Nos and the corresponding culture_dates (datetime). Some of the Reg_nos have multiple culture_date which are in different row compared to the first culture_date for that Reg_no (eg. I have highlighted in red).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to find the difference in minutes and hours from the first culture_date to the next cultre_date if a Reg_No has more than one culture_date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help!&lt;/P&gt;
&lt;P&gt;Satish&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 17:57:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-calculate-datetime-difference-between-two-date-values-in/m-p/234424#M5905</guid>
      <dc:creator>smunigala</dc:creator>
      <dc:date>2015-11-12T17:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate datetime difference between two date values in minutes and hours</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-calculate-datetime-difference-between-two-date-values-in/m-p/234590#M5924</link>
      <description>&lt;P&gt;To be able to&amp;nbsp;calculate this between observations, use a data step with BY, first./last. processing.&lt;/P&gt;
&lt;P&gt;Retain previous observation datetime (if the same reg_no).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simple&amp;nbsp;subtraction will give you the no of seconds between timestamps. Apply time format for display of choice.&lt;/P&gt;
&lt;P&gt;If you need to add more rules to the calculation, ta look at INTCK() function.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-calculate-datetime-difference-between-two-date-values-in/m-p/234590#M5924</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-11-13T13:10:06Z</dc:date>
    </item>
  </channel>
</rss>

