Hmmm. You talk about the objective, but leave it wide open as to what the result should look like. So here is one way to display the result.
data want;
set have;
array counts {4} _temporary_ (0 0 0 0);
array states {4} CA NY PA FL;
do _n_=1 to 4;
if states{_n_} then counts{_n_} = 0;
else counts{_n_} = counts{_n_} + 1;
if counts{_n_} >= 14 then states{_n_} = .F;
end;
run;
This will actually change the data values for CA, NY, PA, and FL. Any time there are at least 14 periods without a death, the value will change to .F (a special missing value). You can inspect the resulting data to look for any sets of .F values. So the output will have the same variables you started with, with .F for the counts when there are at least 14 consecutive no-death days.
Of course, if you have a different outcome in mind, you can always provide details about what it should look like.
... View more