Hello @inason,
If you want MINDT to be a SAS date value (as suggested by your format = date9. specification), you can use a CASE expression:
proc sql;
create table want as
select subject, case when nmiss(dtc) then . else min(input(dtc,yymmdd10.)) end as mindt format=date9.
from visit
where subject ne ' '
group by subject;
quit;
Edit: Or, a bit shorter, replace the above CASE expression by an IFN function call:
ifn(nmiss(dtc),.,min(input(dtc,yymmdd10.)))
... View more