In the data below I would like proc sql to select the minimum date for subject 123 as the missing date. data visit; input subject $1-3 dtc $4-24 ; cards; 123 2014-01-15T00:00 123 123 2014-01-17T00:00:00 124 2014-01-15T00:00:00 124 2014-01-15T00:00:00 124 2014-01-17T00:00:00 ; run; proc sql; create table want. as select distinct subject, min(dtc) as mindt format = date9. from have where subject ne '' group by subject; quit;
... View more