<?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: SAS - Time difference in hour between two fields excluding weekends in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-difference-in-hour-between-two-fields-excluding/m-p/523939#M142423</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144359"&gt;@phoenix31&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to calculate the time difference in hours by excluding weekends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By using the code below to get the difference in hours:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LSC_Time_Diff = intck('hours','Status Time Date'n, 'Current time'n); ------&amp;gt;&amp;nbsp; This gives me the difference in hours but done not exclude weekends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that intck ('Weekday', field1, field2) will exclude weekends&amp;nbsp;however I want to consider the timestamp and see the result in hours.&lt;/P&gt;
&lt;P&gt;PS: I do not want business hours. I just want to exclude weekend hours (Sat &amp;amp; Sun = 48 hrs) to be excluded every time i run my code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise and let me know if more information is needed.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you have a fixed known amount, such as 48 hours then subtract that. I suspect you would want a check that the interval actually crossed a weekend though if you are dealing with irregular intervals.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Dec 2018 17:07:19 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-12-31T17:07:19Z</dc:date>
    <item>
      <title>SAS - Time difference in hour between two fields excluding weekends</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-difference-in-hour-between-two-fields-excluding/m-p/523936#M142421</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate the time difference in hours by excluding weekends.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using the code below to get the difference in hours:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LSC_Time_Diff = intck('hours','Status Time Date'n, 'Current time'n); ------&amp;gt;&amp;nbsp; This gives me the difference in hours but done not exclude weekends.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that intck ('Weekday', field1, field2) will exclude weekends&amp;nbsp;however I want to consider the timestamp and see the result in hours.&lt;/P&gt;&lt;P&gt;PS: I do not want business hours. I just want to exclude weekend hours (Sat &amp;amp; Sun = 48 hrs) to be excluded every time i run my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise and let me know if more information is needed.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Dec 2018 16:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Time-difference-in-hour-between-two-fields-excluding/m-p/523936#M142421</guid>
      <dc:creator>phoenix31</dc:creator>
      <dc:date>2018-12-31T16:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS - Time difference in hour between two fields excluding weekends</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-difference-in-hour-between-two-fields-excluding/m-p/523939#M142423</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144359"&gt;@phoenix31&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to calculate the time difference in hours by excluding weekends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By using the code below to get the difference in hours:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LSC_Time_Diff = intck('hours','Status Time Date'n, 'Current time'n); ------&amp;gt;&amp;nbsp; This gives me the difference in hours but done not exclude weekends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that intck ('Weekday', field1, field2) will exclude weekends&amp;nbsp;however I want to consider the timestamp and see the result in hours.&lt;/P&gt;
&lt;P&gt;PS: I do not want business hours. I just want to exclude weekend hours (Sat &amp;amp; Sun = 48 hrs) to be excluded every time i run my code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise and let me know if more information is needed.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you have a fixed known amount, such as 48 hours then subtract that. I suspect you would want a check that the interval actually crossed a weekend though if you are dealing with irregular intervals.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Dec 2018 17:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Time-difference-in-hour-between-two-fields-excluding/m-p/523939#M142423</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-12-31T17:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS - Time difference in hour between two fields excluding weekends</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-difference-in-hour-between-two-fields-excluding/m-p/523948#M142429</link>
      <description>&lt;P&gt;Subtract&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;intck('dtweek','Status Time Date'n, 'Current time'n) * 48&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Dec 2018 18:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Time-difference-in-hour-between-two-fields-excluding/m-p/523948#M142429</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-31T18:47:34Z</dc:date>
    </item>
  </channel>
</rss>

