Hello SAS support community,
I am working on the following code but keep having errors on the THIRD PART while the first two parts are fine. Thank you so much in advance!
proc sort data=lag out=temp2;
by key fyear dummy lagdummy;
run;
data test2;
set temp2;
by dummy notsorted;
if last.dummy;
count = _n_ - sum(lag(_n_), 0);
do _n_ = 1 to count;
set temp2;
output;
end;
run;
data final2;
set test2;
by key ;
if
lagdummy - dummy =1 then do
if (dummy = 0 and count > 2) or ( dummy= 1 and count > 3) then output;
end;
run;