<?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: datetime20. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54048#M11404</link>
    <description>how about &lt;BR /&gt;
  duration = enddatetime - startdatetime ;&lt;BR /&gt;
the result is in seconds</description>
    <pubDate>Wed, 22 Dec 2010 16:44:11 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2010-12-22T16:44:11Z</dc:date>
    <item>
      <title>datetime20.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54047#M11403</link>
      <description>I have a data set which is like below&lt;BR /&gt;
&lt;BR /&gt;
startdatetime                                     enddatetime&lt;BR /&gt;
12/11/201010:20:30                           12/11/201013:20:40&lt;BR /&gt;
29/12/201010:30:30                           30/12/201015:20:40&lt;BR /&gt;
14/10/201008:40:20                           14/10/201017:30:49&lt;BR /&gt;
&lt;BR /&gt;
now I want difference between startdatetime and  enddatetime .&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Wed, 22 Dec 2010 16:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54047#M11403</guid>
      <dc:creator>arpit</dc:creator>
      <dc:date>2010-12-22T16:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: datetime20.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54048#M11404</link>
      <description>how about &lt;BR /&gt;
  duration = enddatetime - startdatetime ;&lt;BR /&gt;
the result is in seconds</description>
      <pubDate>Wed, 22 Dec 2010 16:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54048#M11404</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-12-22T16:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: datetime20.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54049#M11405</link>
      <description>How do you want the result to be formatted?</description>
      <pubDate>Wed, 22 Dec 2010 16:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54049#M11405</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2010-12-22T16:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: datetime20.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54050#M11406</link>
      <description>this is not working &lt;BR /&gt;
&lt;BR /&gt;
I want in time10. format</description>
      <pubDate>Wed, 22 Dec 2010 18:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54050#M11406</guid>
      <dc:creator>arpit</dc:creator>
      <dc:date>2010-12-22T18:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: datetime20.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54051#M11407</link>
      <description>Possibly, you want to assign a SAS FORMAT statement to the "duration" variable/column result.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
format statement time site:sas.com</description>
      <pubDate>Wed, 22 Dec 2010 18:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54051#M11407</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-12-22T18:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: datetime20.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54052#M11408</link>
      <description>go through google but i could not find .&lt;BR /&gt;
&lt;BR /&gt;
Please help me I am trying so many time but i can't get it&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance</description>
      <pubDate>Wed, 22 Dec 2010 18:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54052#M11408</guid>
      <dc:creator>arpit</dc:creator>
      <dc:date>2010-12-22T18:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: datetime20.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54053#M11409</link>
      <description>What exactly is not working?  When you apply Peter's solution, what error are you getting?  Are your two datetime variables correctly holding SAS datetime values?</description>
      <pubDate>Wed, 22 Dec 2010 18:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54053#M11409</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-12-22T18:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: datetime20.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54054#M11410</link>
      <description>Hi:&lt;BR /&gt;
  Have you tried using the TIME format with your calculated duration??? &lt;BR /&gt;
&lt;BR /&gt;
  Are you certain that all your durations are going to "fit" in TIME10?? What if your duration is more than 9999 hours??? More than 2 years (which is approx 17,000 hours)??&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 22 Dec 2010 20:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54054#M11410</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-12-22T20:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: datetime20.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54055#M11411</link>
      <description>Hello Arpit,&lt;BR /&gt;
&lt;BR /&gt;
I did the following code and got expected result (I only add a blank in input data separating date and time part):&lt;BR /&gt;
[pre]&lt;BR /&gt;
data i;&lt;BR /&gt;
input s anydtdtm19. e anydtdtm19.;&lt;BR /&gt;
format s e datetime20. dur time8.;&lt;BR /&gt;
dur=e-s;&lt;BR /&gt;
datalines;&lt;BR /&gt;
12/11/2010 10:20:30 12/11/2010 13:20:40&lt;BR /&gt;
29/12/2010 10:30:30 30/12/2010 15:20:40&lt;BR /&gt;
14/10/2010 08:40:20 14/10/2010 17:30:49&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
Dataset i:&lt;BR /&gt;
  s                  e                  dur &lt;BR /&gt;
11DEC2010:10:20:30 11DEC2010:13:20:04  2:59:34&lt;BR /&gt;
29DEC2010:10:30:30 30DEC2010:15:20:04 28:49:34&lt;BR /&gt;
14OCT2010:08:40:20 14OCT2010:17:30:04  8:49:44&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Wed, 22 Dec 2010 20:01:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime20/m-p/54055#M11411</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-12-22T20:01:13Z</dc:date>
    </item>
  </channel>
</rss>

