<?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: Count minutes between three different time spaces in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410225#M26305</link>
    <description>&lt;P&gt;sorry to minutes of course! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2017 14:00:30 GMT</pubDate>
    <dc:creator>raafat</dc:creator>
    <dc:date>2017-11-03T14:00:30Z</dc:date>
    <item>
      <title>Count minutes between three different time spaces</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410201#M26300</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;service &amp;nbsp; &amp;nbsp; &amp;nbsp;time&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14:01:00&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14:02:00&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;14:03:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;SPAN&gt;:01:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15:02:00&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;SPAN&gt;:03:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15:04:00&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17:38:00&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17&lt;SPAN&gt;:39:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17:40:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How could I calculate &amp;nbsp;the time spent on &amp;nbsp;the&amp;nbsp;&lt;/SPAN&gt;service "ryk" which is 10 minutes. I have tried several function, but no luck. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 13:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410201#M26300</guid>
      <dc:creator>raafat</dc:creator>
      <dc:date>2017-11-03T13:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count minutes between three different time spaces</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410202#M26301</link>
      <description>&lt;P&gt;From where do you get the ten minutes? I see more than three hours. Or do you just count the rows?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 13:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410202#M26301</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-03T13:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count minutes between three different time spaces</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410218#M26302</link>
      <description>&lt;DIV class="lia-message-heading lia-component-message-header"&gt;&lt;DIV class="lia-quilt-row lia-quilt-row-standard"&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-left"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;&lt;DIV class="lia-message-subject"&gt;Count minutes between three different time spaces&lt;SPAN&gt;this a better example of how data looks like &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV class="MessageReadByModeratorCell lia-moderation-moderated"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;service &amp;nbsp; &amp;nbsp; &amp;nbsp;time&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14:01:00&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14:02:00&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;14:03:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HHH &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;14:04:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HHH &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;14:05:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HHH &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;14:06:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;SPAN&gt;:01:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15:02:00&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;SPAN&gt;:03:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15:04:00&lt;/P&gt;&lt;P&gt;HHH &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ........&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17:38:00&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17&lt;SPAN&gt;:39:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17:40:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want only the time spent on the service "Ryk", so for example the time between 15:04:00 and 17:38:00 is spent on another service.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Nov 2017 13:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410218#M26302</guid>
      <dc:creator>raafat</dc:creator>
      <dc:date>2017-11-03T13:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count minutes between three different time spaces</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410222#M26303</link>
      <description>&lt;P&gt;So does this interval:&lt;/P&gt;
&lt;P&gt;service &amp;nbsp; &amp;nbsp; &amp;nbsp;time&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14:01:00&lt;/P&gt;
&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14:02:00&lt;/P&gt;
&lt;P&gt;Ryk &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;14:03:00&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;represent 2 or 3 minutes?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 13:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410222#M26303</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-03T13:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Count minutes between three different time spaces</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410225#M26305</link>
      <description>&lt;P&gt;sorry to minutes of course! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 14:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410225#M26305</guid>
      <dc:creator>raafat</dc:creator>
      <dc:date>2017-11-03T14:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Count minutes between three different time spaces</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410330#M26307</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/92001"&gt;@raafat&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;sorry to minutes of course! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Nothing to be sorry about but intervals usually have a start and end. We don't have any information whether that time value represents either. So there may have been an implied duration of one minute associated with each value, or 10 seconds, or something else.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 16:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410330#M26307</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-03T16:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count minutes between three different time spaces</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410333#M26308</link>
      <description>&lt;P&gt;So you have a strict sequence of times, and the service changes. Everytime the service changes, a new block starts, and the time shall be counted at the next service change. Since every row represents one minute, the first block would be three minutes, although the span between first and last time is only two minutes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that a correct summary?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 16:27:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410333#M26308</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-03T16:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count minutes between three different time spaces</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410338#M26309</link>
      <description>&lt;P&gt;This accumulates seconds for service=Ryk. With the previous response about the first three records = 2 minutes, that would be 60 seconds. The second total is carried across all records.&lt;/P&gt;
&lt;P&gt;Note that if you have times that cross midnight this will not work. If so you should use datetime values instead of times.&lt;/P&gt;
&lt;P&gt;If you need this total for other services this approach could get very cumbersome as you would need a different accumulator variable for each series and assign the total as needed (that is not the hard part) and would require knowing how many services and what each one is before hand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
   informat service  $5.    time time.;
   input service time;
   format time time.;
datalines;
Ryk          14:01:00
Ryk          14:02:00
Ryk          14:03:00
HHH          14:04:00
HHH          14:05:00
HHH          14:06:00
Ryk          15:01:00
Ryk          15:02:00
Ryk          15:03:00
Ryk          15:04:00
HHH          17:24:00
Ryk          17:38:00
Ryk          17:39:00
Ryk          17:40:00
;
run;

data want;
   set have;
   by notsorted service ;
   retain svcsum .;
   timedif= dif(time);
   if first.service then ;
   else if service='Ryk' then svcsum=sum(svcsum,timedif); 
   drop timedif;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Nov 2017 16:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/410338#M26309</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-03T16:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count minutes between three different time spaces</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/411838#M26462</link>
      <description>&lt;P&gt;Thank you very much. Exactly what i was looking for &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 08:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-minutes-between-three-different-time-spaces/m-p/411838#M26462</guid>
      <dc:creator>raafat</dc:creator>
      <dc:date>2017-11-09T08:51:05Z</dc:date>
    </item>
  </channel>
</rss>

