Hi,
looks like you got a mistake in the derivation you want.
SDTMIG says:
RFPENDTC=Date/time when subject ended participation or follow-up in a trial, as defined in the protocol, in ISO 8601 character format. Should correspond to the last known date of contact. Examples include completion date, withdrawal date, last follow-up, date recorded for lost to follow up, and death date.
The date of the last column is not the latest date in your dataset and your lastdt seems to be erroneously derived.
In fact your whole dataset is erroneous since even your start date is after your end date
data want;
set sdtm;
wantRFPENTC=coalesce(lastdt,FUMTC,RFENDTC,RFSTDTC,RFICDTC);
CorrectRFPENDTC=max(lastdt,FUMTC,RFENDTC,RFSTDTC,RFICDTC);
format wantRFPENTC CorrectRFPENDTC ddmmyy10.;
keep id wantRFPENTC CorrectRFPENDTC ;
run;
... View more