<?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 in a 60 Minute window in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472032#M70967</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;"&lt;SPAN&gt;I have a data set that contains a datetime value that ive created from separate date and time variables and a unique identifier "IP""&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Therefore:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data have;
  input ip dt e8601dt.;&lt;BR /&gt;  new_date
datalines;
123456 2017-08-21T12:01:00
123456 2017-08-26T11:00:00
...
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;This means we can run it on our machine to get data which looks like yours.&amp;nbsp; Without this we are guessing, and hence can't write tested code which accurately&amp;nbsp;answers your question.&amp;nbsp; SAS is a data driven programming language, so the data is very important to any coding.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In terms of your question, step 1 would be to create a variable based on what your window is.&amp;nbsp; Maybe:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  retain base group;
  by ip;
  if first.ip=1 then do;
    group=1;
    base=dt;
  end;
  else do;
    if dt-base &amp;gt; ... then do;
      group=group+1;
      base=dt;
    end;
  end;
run;
  &lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;So this keeps a "base" time, and changes group and base only when something goes outside the 60 minute window - how you do that check is up to you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i understand completely I wasn't myself trying to be rude I just didn't see any obvious instructions on how to do it for an amateur and don't appreciate the sarcastic comments.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really do appreciate the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm more than happy to though&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 10:22:52 GMT</pubDate>
    <dc:creator>Stretlow</dc:creator>
    <dc:date>2018-06-21T10:22:52Z</dc:date>
    <item>
      <title>Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472016#M70961</link>
      <description>&lt;P&gt;Hi There.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set that contains a datetime value that ive created from separate date and time variables and a unique identifier "IP" which is character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What i cant quite figure out is I want to show a count of the same "IP" in a 60 minute window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so for example&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Count&lt;/P&gt;
&lt;P&gt;123456&amp;nbsp; &amp;nbsp;6&lt;/P&gt;
&lt;P&gt;654321&amp;nbsp; &amp;nbsp;1&lt;/P&gt;
&lt;P&gt;233242&amp;nbsp; &amp;nbsp;7&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help as always is appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stret&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 09:07:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472016#M70961</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2018-06-21T09:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472021#M70962</link>
      <description>&lt;P&gt;Please post an example of your data (see my footnotes for how to post data) from which your expected result is to be derived.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 09:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472021#M70962</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-21T09:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472025#M70963</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Please post an example of your data (see my footnotes for how to post data) from which your expected result is to be derived.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi there i've attached a sample excel sheet&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apologies.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 09:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472025#M70963</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2018-06-21T09:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472027#M70964</link>
      <description>&lt;P&gt;Excel spreadsheets are not SAS datasets, and they cannot be used to reliably represent SAS datasets (no column attributes etc). Furthermore, they can be used to transport malware, so many corporate institutions block their download.&lt;/P&gt;
&lt;P&gt;Please follow the hints contained in my footnotes. It is NOT rocket science.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, I can perfectly read SAS code on my tablet without need for any special app.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 09:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472027#M70964</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-21T09:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472028#M70965</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Excel spreadsheets are not SAS datasets, and they cannot be used to reliably represent SAS datasets (no column attributes etc). Furthermore, they can be used to transport malware, so many corporate institutions block their download.&lt;/P&gt;
&lt;P&gt;Please follow the hints contained in my footnotes. It is NOT rocket science.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, I can perfectly read SAS code on my tablet without need for any special app.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure the rudeness was warranted however I have looked at the three links in your signature and while&amp;nbsp;it may not be rocket science i do not see the easy way to post the data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is obviously beyond my level of understanding, which I make no apologies for, I am just looking for a little assistance on something that i don't know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stret&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 10:06:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472028#M70965</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2018-06-21T10:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472031#M70966</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;I have a data set that contains a datetime value that ive created from separate date and time variables and a unique identifier "IP""&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Therefore:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data have;
  input ip dt e8601dt.;&lt;BR /&gt;  new_date
datalines;
123456 2017-08-21T12:01:00
123456 2017-08-26T11:00:00
...
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;This means we can run it on our machine to get data which looks like yours.&amp;nbsp; Without this we are guessing, and hence can't write tested code which accurately&amp;nbsp;answers your question.&amp;nbsp; SAS is a data driven programming language, so the data is very important to any coding.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In terms of your question, step 1 would be to create a variable based on what your window is.&amp;nbsp; Maybe:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  retain base group;
  by ip;
  if first.ip=1 then do;
    group=1;
    base=dt;
  end;
  else do;
    if dt-base &amp;gt; ... then do;
      group=group+1;
      base=dt;
    end;
  end;
run;
  &lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;So this keeps a "base" time, and changes group and base only when something goes outside the 60 minute window - how you do that check is up to you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 10:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472031#M70966</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-21T10:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472032#M70967</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;"&lt;SPAN&gt;I have a data set that contains a datetime value that ive created from separate date and time variables and a unique identifier "IP""&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Therefore:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data have;
  input ip dt e8601dt.;&lt;BR /&gt;  new_date
datalines;
123456 2017-08-21T12:01:00
123456 2017-08-26T11:00:00
...
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;This means we can run it on our machine to get data which looks like yours.&amp;nbsp; Without this we are guessing, and hence can't write tested code which accurately&amp;nbsp;answers your question.&amp;nbsp; SAS is a data driven programming language, so the data is very important to any coding.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In terms of your question, step 1 would be to create a variable based on what your window is.&amp;nbsp; Maybe:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  retain base group;
  by ip;
  if first.ip=1 then do;
    group=1;
    base=dt;
  end;
  else do;
    if dt-base &amp;gt; ... then do;
      group=group+1;
      base=dt;
    end;
  end;
run;
  &lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;So this keeps a "base" time, and changes group and base only when something goes outside the 60 minute window - how you do that check is up to you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i understand completely I wasn't myself trying to be rude I just didn't see any obvious instructions on how to do it for an amateur and don't appreciate the sarcastic comments.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really do appreciate the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm more than happy to though&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 10:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472032#M70967</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2018-06-21T10:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472040#M70969</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;"&lt;SPAN&gt;I have a data set that contains a datetime value that ive created from separate date and time variables and a unique identifier "IP""&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Therefore:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data have;
  input ip dt e8601dt.;&lt;BR /&gt;  new_date
datalines;
123456 2017-08-21T12:01:00
123456 2017-08-26T11:00:00
...
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;This means we can run it on our machine to get data which looks like yours.&amp;nbsp; Without this we are guessing, and hence can't write tested code which accurately&amp;nbsp;answers your question.&amp;nbsp; SAS is a data driven programming language, so the data is very important to any coding.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In terms of your question, step 1 would be to create a variable based on what your window is.&amp;nbsp; Maybe:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  retain base group;
  by ip;
  if first.ip=1 then do;
    group=1;
    base=dt;
  end;
  else do;
    if dt-base &amp;gt; ... then do;
      group=group+1;
      base=dt;
    end;
  end;
run;
  &lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;So this keeps a "base" time, and changes group and base only when something goes outside the 60 minute window - how you do that check is up to you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi Again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ok i think I see what you mean now, apologies for my knowledge on this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so if you run this code&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt; input IP DateTime DATETIME18.;&lt;/P&gt;
&lt;P&gt;datalines;&lt;BR /&gt;123456 31MAR18:23:58:52&lt;BR /&gt;123456 31MAR18:23:57:19&lt;BR /&gt;123456 31MAR18:23:55:46&lt;BR /&gt;654321 31MAR18:23:44:18&lt;BR /&gt;654321 31MAR18:23:35:11&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then it will give you some sample data that is in the same format as mine, is that was you require?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so the output of the count would be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Count in 60 mins&lt;/P&gt;
&lt;P&gt;123456&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;
&lt;P&gt;654321&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stret&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 11:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472040#M70969</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2018-06-21T11:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472043#M70970</link>
      <description>&lt;P&gt;A simple and short approach might look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select ip, datepart(datetime) as date, hour(timepart(datetime)) as hour, count(*) as count
from have
group by ip, calculated date, calculated hour;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need a different definition of "hour" (the sixty-minute window), you might have to create "hour" in a preliminary (data) step.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 11:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472043#M70970</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-21T11:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count in a 60 Minute window</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472084#M70971</link>
      <description>&lt;P&gt;When you say 60 Min, Which 60 min do you want to consider? Is&amp;nbsp; it from the first timestamp value, then look at this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
Format DateTime DATETIME18.;
input IP DateTime DATETIME18.;
datalines;
123456 31MAR18:21:58:52
123456 31MAR18:21:57:19
123456 31MAR18:21:55:46
123456 31MAR18:23:55:46
123456 31MAR18:23:58:46
654321 31MAR18:23:44:18
654321 31MAR18:23:35:11
;
run;
/* Sort the data first */
PROC SORT DATA=have;
by IP DateTime;
run;

DATA WANT;
Format lag_Date DATETIME18.;
Retain Time;
set have;
by  IP DateTime;
lag_Date=LAG(DateTime); /* Previous DateTime to Compare with current DateTime */
If first.IP then Do;
		lag_Date=DateTime;
		Time=0;
		Count=1;
		end;
else Time+INTCK('SECONDS',lag_Date,DateTime); /* Number of seconds from previous Datetime to current Datetime */
If time&amp;lt;=60*60 and time^=0 then count+1;
If last.IP;
Keep IP Count;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;else, if you want to count every hourly then use HOUR() for hour and sort the data&amp;nbsp; by IP DATE and Hour and use FIRST. for these by variables for count.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want2;
set have;
hour=hour(DateTime);
Date=datepart(Datetime);
run;

Proc sort data=want2;
by IP Date Hour;
run;
data final;
set want2;
by IP Date Hour;
if first.Hour then count=1;
else count+1;
if last.hour;
keep IP Hour Count;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jun 2018 13:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-in-a-60-Minute-window/m-p/472084#M70971</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-06-21T13:17:12Z</dc:date>
    </item>
  </channel>
</rss>

