<?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: How to select rows having transactions on three consecutive days in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420425#M67874</link>
    <description>&lt;P&gt;Here is a solution using SET with POINT=:&lt;/P&gt;&lt;PRE&gt;proc sort data=transaction;
  by id date;
run;

data want;
  set transaction(keep=id date);
  by id date;
  if first.id then
    call missing(date2,date3);
  if last.date and not missing(date3) then do;
    if date-date3=2 then do p2=p3 to _N_;
      set transaction point=p2;
      output;
      end;
    end;
  if first.date then do;
    date3=date2;
    p3=p2;
    date2=date;
    p2=_N_;
    end;
  retain date2 date3 p3 p2;
  drop date2 date3 p3;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2017 11:27:56 GMT</pubDate>
    <dc:creator>s_lassen</dc:creator>
    <dc:date>2017-12-12T11:27:56Z</dc:date>
    <item>
      <title>How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420351#M67870</link>
      <description>&lt;P&gt;Below is my sample data. I want to select those rows which have at least 3 consecutive transactions. For example, for id 11 we have transaction on 5th, 6th and 7th day of January. But 12,13,14 does not have 3 consecutive transactions. I want to create a code which will select only id 11 and its all 3 consecutive transactions. I think it can be done in PROC SQL using some kind of counter. But not sure how to go about it.&amp;nbsp; Any idea about it will be highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data transaction;
input @1 id 2.
	  @3 amount 3.
	  @8 date MMDDYY10. ;
format date date9.;
datalines;
11 100 01/05/2015
11 150 01/06/2015
11 200 01/07/2015
12 150 01/25/2015
12 300 01/15/2015
13 100 01/08/2015
14 400 01/02/2015 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2017 03:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420351#M67870</guid>
      <dc:creator>shihabur</dc:creator>
      <dc:date>2017-12-12T03:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420355#M67871</link>
      <description>&lt;P&gt;A couple of questions: 1) do you need to handle instances of multiple transactions on the same day? and 2) how do you want to handle instances where transactions occur on 4 or more consecutive days.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intuitively, a self-join would be better than any form of counter, or alternatively, multi-pass data step solutions.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 03:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420355#M67871</guid>
      <dc:creator>DaveBirch</dc:creator>
      <dc:date>2017-12-12T03:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420359#M67872</link>
      <description>&lt;P&gt;Two methods:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sql;
create table consec as
select unique
    a.*
from
    transaction as a inner join
    (select b.id, b.date, d.date 
     from 
        transaction as b inner join
        transaction as c on b.id=c.id and intnx('day',b.date,1)=c.date inner join
        transaction as d on c.id=d.id and intnx('day',c.date,1)=d.date) 
     on a.id=b.id and a.date between b.date and d.date
order by id, date;
select * from consec;
quit;

data sequences;
retain series 0;
set transaction; by id;
prevDate = lag(date);
if first.id then series = series + 1;
else if date ne intnx('day', prevDate, 1) then series = series + 1;
drop prevDate;
run;

data consecutive;
do c = 1 by 1 until(last.series);
    set sequences; by id series;
    end;
do until(last.series);
    set sequences; by id series;
    if c &amp;gt;= 3 then output;
    end;
drop series c;
run;

proc print data=consecutive noobs; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2017 04:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420359#M67872</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-12-12T04:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420364#M67873</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is not your requirement, but I have added some more lines of data , hope it helps&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; transaction;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; @&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; id &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;@&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; amount &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;@&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;8&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;MMDDYY10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;11 100 01/05/2015&lt;/P&gt;&lt;P&gt;11 150 01/06/2015&lt;/P&gt;&lt;P&gt;11 200 01/07/2015&lt;/P&gt;&lt;P&gt;11 200 01/10/2015&lt;/P&gt;&lt;P&gt;11 100 01/15/2015&lt;/P&gt;&lt;P&gt;11 150 01/16/2015&lt;/P&gt;&lt;P&gt;11 200 01/17/2015&lt;/P&gt;&lt;P&gt;12 150 01/25/2015&lt;/P&gt;&lt;P&gt;12 300 01/15/2015&lt;/P&gt;&lt;P&gt;13 100 01/08/2015&lt;/P&gt;&lt;P&gt;14 400 01/02/2015&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=transaction; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; id date; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; transaction_1 ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; transaction;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; id date;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt= lag(date);&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; first.id &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dt=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;diff = date-dt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dt &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; transaction_2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; transaction_1(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=(diff=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; not missing(date) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dummy = date;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; not missing(dt) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dummy = dt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dummy &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; fin &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New" size="2"&gt;a.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;* &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; transaction a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;inner&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; id,dummy &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; transaction_2) b&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a.id= b.id&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a.date=b.dummy&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 05:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420364#M67873</guid>
      <dc:creator>RM6</dc:creator>
      <dc:date>2017-12-12T05:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420425#M67874</link>
      <description>&lt;P&gt;Here is a solution using SET with POINT=:&lt;/P&gt;&lt;PRE&gt;proc sort data=transaction;
  by id date;
run;

data want;
  set transaction(keep=id date);
  by id date;
  if first.id then
    call missing(date2,date3);
  if last.date and not missing(date3) then do;
    if date-date3=2 then do p2=p3 to _N_;
      set transaction point=p2;
      output;
      end;
    end;
  if first.date then do;
    date3=date2;
    p3=p2;
    date2=date;
    p2=_N_;
    end;
  retain date2 date3 p3 p2;
  drop date2 date3 p3;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 11:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420425#M67874</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2017-12-12T11:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420443#M67877</link>
      <description>&lt;P&gt;1. Yes. I also need to find situations where there are multiple transactions in one day. But I can find it easily by using a group by and count function within proc sql. But not within same query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. So, the aim is to get a general process in the end, like 3/4/5 or any number of consecutive day transactions. For time being, I am just starting with 3.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 12:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420443#M67877</guid>
      <dc:creator>shihabur</dc:creator>
      <dc:date>2017-12-12T12:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420446#M67879</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data transaction;
input @1 id 2.
	  @3 amount 3.
	  @8 date MMDDYY10. ;
format date date9.;
datalines;
11 100 01/05/2015
11 150 01/06/2015
11 200 01/07/2015
12 150 01/25/2015
12 300 01/15/2015
13 100 01/08/2015
14 400 01/02/2015 
;
run;
data temp;
 set transaction;
 by id;
 dif=dif(date);
 if first.id then dif=1;
run;
data temp1;
 set temp;
 by id dif notsorted;
 group+first.dif;
run;
proc sql;
create table want as
 select *
  from temp1
   group by group
    having sum(dif=1) ge 3;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2017 12:47:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420446#M67879</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-12-12T12:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420549#M67884</link>
      <description>&lt;P&gt;Thanks a lot. This solves the problem perfectly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 18:26:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420549#M67884</guid>
      <dc:creator>shihabur</dc:creator>
      <dc:date>2017-12-12T18:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420893#M67928</link>
      <description>&lt;P&gt;I understood the proc sql method. While data step method works fine too, I am still not sure how it is working. I get the first part of the data step method where this is mentioned.&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;date&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;ne&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;intnx&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'day'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; prevDate&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; series &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; series &lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the next part after that where you are using do until, I am not being able to understand how its working, specially why do until is being used twice. Can you give me some hints kindly ?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 16:56:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420893#M67928</guid>
      <dc:creator>shihabur</dc:creator>
      <dc:date>2017-12-13T16:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420998#M67940</link>
      <description>&lt;P&gt;Thanks for providing the solution. I am going through the code and can not understand p2/p3 part&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if date-date3=2 then do p2=p3 to _N_;
      set transaction point=p2;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have not encountered this before p2 = p3 or p3 =p2. Can you please give some clues about it ?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 21:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/420998#M67940</guid>
      <dc:creator>shihabur</dc:creator>
      <dc:date>2017-12-13T21:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows having transactions on three consecutive days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/421072#M67950</link>
      <description>&lt;P&gt;In the first loop, counter c counts the number of rows with the same id and series number, i.e. the length of the sequence. In the second loop, going over exactly the same sequence, the rows are output if the sequence length is &amp;gt;= 3.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 04:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-rows-having-transactions-on-three-consecutive-days/m-p/421072#M67950</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-12-14T04:04:34Z</dc:date>
    </item>
  </channel>
</rss>

