<?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 Keeping 15 min in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Keeping-15-min/m-p/239269#M55518</link>
    <description>&lt;P&gt;data t;&lt;BR /&gt;set t1 t2;&lt;BR /&gt;dt = dhms(date, hour(time), minute(time), second(time));&lt;BR /&gt;format dt datetime19. date date9. time time8.;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=t; by machine dt; run;&lt;BR /&gt;/* Drop records that are less than 15 min. from previous */&lt;BR /&gt;data want;&lt;BR /&gt;do until(last.machine);&lt;BR /&gt;set t; by machine;&lt;BR /&gt;if dt - '00:15:00't &amp;gt; lastDT then do;&lt;BR /&gt;output;&lt;BR /&gt;lastDT = dt;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;drop lastDT;&lt;BR /&gt;run;&lt;BR /&gt;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&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2015 22:41:24 GMT</pubDate>
    <dc:creator>BETO</dc:creator>
    <dc:date>2015-12-14T22:41:24Z</dc:date>
    <item>
      <title>Keeping 15 min</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Keeping-15-min/m-p/239269#M55518</link>
      <description>&lt;P&gt;data t;&lt;BR /&gt;set t1 t2;&lt;BR /&gt;dt = dhms(date, hour(time), minute(time), second(time));&lt;BR /&gt;format dt datetime19. date date9. time time8.;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=t; by machine dt; run;&lt;BR /&gt;/* Drop records that are less than 15 min. from previous */&lt;BR /&gt;data want;&lt;BR /&gt;do until(last.machine);&lt;BR /&gt;set t; by machine;&lt;BR /&gt;if dt - '00:15:00't &amp;gt; lastDT then do;&lt;BR /&gt;output;&lt;BR /&gt;lastDT = dt;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;drop lastDT;&lt;BR /&gt;run;&lt;BR /&gt;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&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 22:41:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Keeping-15-min/m-p/239269#M55518</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-12-14T22:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping 15 min</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Keeping-15-min/m-p/239274#M55519</link>
      <description>What's previous?  Say record 1, you have everything within 15 mins. Record 3 is within 15 mins of Record 1. Record 5 is within 15 mins of Record 1 and 3.&lt;BR /&gt;&lt;BR /&gt;How do you want the output to look?</description>
      <pubDate>Tue, 15 Dec 2015 01:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Keeping-15-min/m-p/239274#M55519</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-15T01:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping 15 min</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Keeping-15-min/m-p/239290#M55524</link>
      <description>&lt;P&gt;data t1;&lt;BR /&gt;input Machine $ Time :time8. Date :mmddyy8.;&lt;BR /&gt;datalines; &lt;BR /&gt;A1 15:35:35 11/07/15&lt;BR /&gt;A2 10:59:06 11/04/15&lt;BR /&gt;A1 15:42:23 11/07/15&lt;BR /&gt;;&lt;BR /&gt;data t2;&lt;BR /&gt;input Machine $ Time :time8. Date :mmddyy8.;&lt;BR /&gt;datalines; &lt;BR /&gt;A1 15:38:35 11/07/15&lt;BR /&gt;A2 10:55:06 11/04/15&lt;BR /&gt;A3 15:45:23 11/07/15&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;/* Concatenate the tables, create datetimes */&lt;BR /&gt;data t;&lt;BR /&gt;set t1 t2;&lt;BR /&gt;dt = dhms(date, hour(time), minute(time), second(time));&lt;BR /&gt;format dt datetime19. date date9. time time8.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sort data=t; by machine dt; run;&lt;/P&gt;
&lt;P&gt;/* Drop records that are less than 15 min. from previous */&lt;BR /&gt;data want;&lt;BR /&gt;do until(last.machine);&lt;BR /&gt; set t; by machine;&lt;BR /&gt; if dt - '00:15:00't &amp;gt; lastDT then do;&lt;BR /&gt; output;&lt;BR /&gt; lastDT = dt;&lt;BR /&gt; end;&lt;BR /&gt; end;&lt;BR /&gt;drop lastDT;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc print data=want noobs; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;instead of of removing them I wanted to keep 15 min or less an remove 15 min greater&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 05:16:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Keeping-15-min/m-p/239290#M55524</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-12-15T05:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping 15 min</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Keeping-15-min/m-p/239303#M55525</link>
      <description>&lt;P&gt;You did not post the output yet ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t1;
input Machine $ Time :time8. Date :mmddyy8.;
datalines; 
A1 15:35:35 11/07/15
A2 10:59:06 11/04/15
A1 15:42:23 11/07/15
;
data t2;
input Machine $ Time :time8. Date :mmddyy8.;
datalines; 
A1 15:38:35 11/07/15
A2 10:55:06 11/04/15
A3 15:45:23 11/07/15
;
data t;
set t1 t2;
dt = dhms(date,0,0,time);
format dt datetime19. date date9. time time8.;
run;
proc sort data=t; by machine dt; run;
data want;
 set t;
 if Machine eq lag(Machine) and dif(dt) le '00:15:00't;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 09:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Keeping-15-min/m-p/239303#M55525</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-15T09:36:36Z</dc:date>
    </item>
  </channel>
</rss>

