Assuming you want to compare fill date to previous record end date. Use a retain variable in your data step. data laterefills; set exampledata; by ID; retain last_end_dt .; if first.id then call missing(last_end_dt); if fill_dt>last_end_dt and first.id=0 then output; last_end_dt=end_dt; run;
... View more