<?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 covert elasped time and calculating the time difference in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-covert-elasped-time-and-calculating-the-time-difference/m-p/281824#M57187</link>
    <description>&lt;P&gt;I have imported a data set from excel and I want to calculate the difference between two columns, StdTime and FinTime.&amp;nbsp; The format in SAS data set looks like this:&lt;/P&gt;&lt;P&gt;StdTime&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FinTime&lt;/P&gt;&lt;P&gt;5:30.45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5:33.02&lt;/P&gt;&lt;P&gt;4:20.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4:15.14&lt;/P&gt;&lt;P&gt;6:03.55&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6:05.21&lt;/P&gt;&lt;P&gt;where the text above read as m:ss.millisec and the time should be less tha 10mins.&lt;/P&gt;&lt;P&gt;I want to add a column to my existing data set for the time difference between these two columns for each row but it seems the time format is not readable by SAS.&amp;nbsp; Please kindly help and thank you for your attention.&lt;/P&gt;</description>
    <pubDate>Sat, 02 Jul 2016 03:15:09 GMT</pubDate>
    <dc:creator>acma</dc:creator>
    <dc:date>2016-07-02T03:15:09Z</dc:date>
    <item>
      <title>How to covert elasped time and calculating the time difference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-covert-elasped-time-and-calculating-the-time-difference/m-p/281824#M57187</link>
      <description>&lt;P&gt;I have imported a data set from excel and I want to calculate the difference between two columns, StdTime and FinTime.&amp;nbsp; The format in SAS data set looks like this:&lt;/P&gt;&lt;P&gt;StdTime&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FinTime&lt;/P&gt;&lt;P&gt;5:30.45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5:33.02&lt;/P&gt;&lt;P&gt;4:20.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4:15.14&lt;/P&gt;&lt;P&gt;6:03.55&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6:05.21&lt;/P&gt;&lt;P&gt;where the text above read as m:ss.millisec and the time should be less tha 10mins.&lt;/P&gt;&lt;P&gt;I want to add a column to my existing data set for the time difference between these two columns for each row but it seems the time format is not readable by SAS.&amp;nbsp; Please kindly help and thank you for your attention.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2016 03:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-covert-elasped-time-and-calculating-the-time-difference/m-p/281824#M57187</guid>
      <dc:creator>acma</dc:creator>
      <dc:date>2016-07-02T03:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert elasped time and calculating the time difference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-covert-elasped-time-and-calculating-the-time-difference/m-p/281828#M57188</link>
      <description>&lt;P&gt;You can read them this way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input (t1 t2) ($);
StdTime = input(cats("0:",t1),anydttme11.);
FinTime = input(cats("0:",t2),anydttme11.);
difTime = FinTime - StdTime;
format StdTime FinTime difTime time12.2;
drop t1 t2;
datalines;
5:30.45      5:33.02
4:20.10      4:15.14
6:03.55      6:05.21
;
proc print; run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Jul 2016 04:22:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-covert-elasped-time-and-calculating-the-time-difference/m-p/281828#M57188</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-07-02T04:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert elasped time and calculating the time difference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-covert-elasped-time-and-calculating-the-time-difference/m-p/281831#M57189</link>
      <description>I changed your code a little bit to fit as a data set column and works flawlessly. Thanks for your solution.</description>
      <pubDate>Sat, 02 Jul 2016 06:23:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-covert-elasped-time-and-calculating-the-time-difference/m-p/281831#M57189</guid>
      <dc:creator>acma</dc:creator>
      <dc:date>2016-07-02T06:23:15Z</dc:date>
    </item>
  </channel>
</rss>

