Hi Ksharp, The codes that you have provided to me (which are aliter for below codes provided by PGStats) are giving distinct number of observations. Can you please look into it. 1. Even after changing the pre_sum do interval to: <do i =-12 to -1> and, 2. I am sure that there are no duplicates in final dataset that I get after running PGStats codes and your codes. data enrolment;
set sasforum.annual_cut;
array memday{12};
indexMonth = intnx("MONTH", index_dt, 0);
do i = 1 to 12;
month = mdy(i, 1, year);
days = memday{i};
if -12 <= intck("MONTH", indexMonth, month) <= 11 then output;
end;
format month indexMonth yymm.;
keep enrolId indexMonth month days;
run;
proc sql;
create table continuous as
select enrolId, indexMonth
from enrolment
group by enrolId, indexMonth
having sum(days) >= 2*365;
quit; Thanks!
... View more