Step 1: Fix the data type of the variable date, changing it to a numeric variable with a date format attached.
Untested:
data work.date_fixed;
set work.test(rename=(date = str_date));
date = input(str_date, mmddyy10.);
format date date9.;
drop str_date;
run;
Step 2: Use a retained variable to store the date variable when phase = "closed", a subsetting-if can be used to keep only obs with date > retained_date. If you have multiple ids in the data, i am sure your need retained_date set to missing if the id changes.
... View more