I think you want first.dose as you want the first occurence of dosedate within a dose, correct? But WHICH dose dates are missing? If you sorted your data by usubjid dose and dosedate then the first dosedate(s) would be the missing ones.
I might look at
Proc summary data=lab1 nway;
class usubjid dose;
where dosedate ne .; var dosedate;
output lab min(dosedate) = firstdosedate;
run;
The 2025 SAS Hackathon has begun!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.