<?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 Is there a way to show 13:00 - 15:00 (hh:mm - hh:mm) = - 02:00 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589461#M168604</link>
    <description>&lt;P&gt;I am trying to take the difference between the current time and a scheduled time which are in HH:MM format (I used TOD5.2 to convert them) and see negative hours.&lt;/P&gt;&lt;P&gt;Please let me know if more information is needed.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2019 19:13:46 GMT</pubDate>
    <dc:creator>phoenix31</dc:creator>
    <dc:date>2019-09-17T19:13:46Z</dc:date>
    <item>
      <title>Is there a way to show 13:00 - 15:00 (hh:mm - hh:mm) = - 02:00</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589461#M168604</link>
      <description>&lt;P&gt;I am trying to take the difference between the current time and a scheduled time which are in HH:MM format (I used TOD5.2 to convert them) and see negative hours.&lt;/P&gt;&lt;P&gt;Please let me know if more information is needed.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 19:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589461#M168604</guid>
      <dc:creator>phoenix31</dc:creator>
      <dc:date>2019-09-17T19:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to show 13:00 - 15:00 (hh:mm - hh:mm) = - 02:00</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589463#M168605</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144359"&gt;@phoenix31&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you mean this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data w;
t1='13:00't;
t2='15:00't;
dif=intck('hour',t2,t1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2019 19:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589463#M168605</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-17T19:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to show 13:00 - 15:00 (hh:mm - hh:mm) = - 02:00</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589479#M168612</link>
      <description>&lt;P&gt;Or perhaps, are you looking for picture format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc format;
   picture hr (default=6)
 low -  -1      =   '99:99' (prefix='-' mult=100)
  1  - high     =  '99:99' ( mult=100);
  ;

data want;
t1='13:00't;
t2='15:00't;
dif=intck('hour',t2,t1);
format dif hr. t time5.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2019 20:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589479#M168612</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-17T20:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to show 13:00 - 15:00 (hh:mm - hh:mm) = - 02:00</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589727#M168713</link>
      <description>&lt;P&gt;Thank you for the update. The code you provided works when both values are in numeric format.&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
t1&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token datetime number"&gt;'13:00't&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
t2&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token datetime number"&gt;'15:00't&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;dif&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;intck&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'hour'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;t2&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;t1&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My fields are in hh:mm format and if converted to numeric then the years, months ,days&amp;nbsp; and seconds since 1960.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the below code but when the hours are negative my values are not right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work.demo_1;&lt;BR /&gt;set work.demo_base;&lt;BR /&gt;format dif tod5.2;&lt;BR /&gt;dif='Time1'n - 'Time2'n;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 16:26:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589727#M168713</guid>
      <dc:creator>phoenix31</dc:creator>
      <dc:date>2019-09-18T16:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to show 13:00 - 15:00 (hh:mm - hh:mm) = - 02:00</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589730#M168716</link>
      <description>&lt;P&gt;Why would you store time values with years included?&lt;/P&gt;
&lt;P&gt;Do you have DATETIME values instead?&lt;/P&gt;
&lt;P&gt;Even so the difference between two datetime values is still going to be a number of seconds. But it could be many days worth of seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you want extract just the time part from the datetime value and compare those?&amp;nbsp; If so use the TIMEPART() function to extract just the time since midnight from your time since 1960 values.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 16:38:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-show-13-00-15-00-hh-mm-hh-mm-02-00/m-p/589730#M168716</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-18T16:38:25Z</dc:date>
    </item>
  </channel>
</rss>

