When I get LOTS of possibly unexpected output look at where OUTPUT statements are located.
I would examine all of the variables involved with this block of code:
do while (difference < 100);
if last.ID2 then do;
_n_ = row;
call missing(ABC);
days = days + plus;
difference = abs(today() - days);
row = _n_+1;
output;
end;
end;
If your PLUS variable ever is negative your value of difference has the potential to cause lots of issues with values of -1, -2, -3, -1000000.
I might suggest should the do while value be (0 <= difference <100) or similar
... View more