Help using Base SAS procedures

Keep only 15 min intervals

Accepted Solution Solved
Reply
Regular Contributor
Posts: 240
Accepted Solution

Keep only 15 min intervals

[ Edited ]

data t;
set t1 t2;
dt = dhms(date, hour(time), minute(time), second(time));
format dt datetime19. date date9. time time8.;
run;

proc sort data=t; by machine dt; run;

/* Drop records that are less than 15 min. from previous */
data want;
do until(last.machine);
set t; by machine;
if dt - '00:15:00't > lastDT then do;
output;
lastDT = dt;
end;
end;
drop lastDT;
run;

 

Hi pgstats. How would it look like if I wanted to keep everything within 15min? ... If it was greater than 15 min drop.. Table one columns would be machine time date. Table 2 machine start date end date duration time


Accepted Solutions
Solution
‎12-14-2015 05:30 PM
Super User
Posts: 17,868

Re: Keep 15 min pgstats

Please don't direct your question to one person, but to the forum in general. That person may or may not have time to answer your question and it's meant to be a public forum.

View solution in original post


All Replies
Super User
Posts: 5,260

Re: Keep 15 min pgstats

Believe it or not, but all community visitors can see this message.

If you wish to send a personal/direct/private message, go to that persons profile, and click on "Send this user a private message", in the "Contact me" box to right.

Data never sleeps
Solution
‎12-14-2015 05:30 PM
Super User
Posts: 17,868

Re: Keep 15 min pgstats

Please don't direct your question to one person, but to the forum in general. That person may or may not have time to answer your question and it's meant to be a public forum.
Regular Contributor
Posts: 240

Re: Keep 15 min pgstats

My mistake I was aware it was public the person help me with a same question I fig it was easy to address it to them ...
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 357 views
  • 0 likes
  • 3 in conversation