Here is a method that is the same but different. 😀
data have;
infile datalines delimiter=',';
id + 1;
input A :yymmdd10. B :yymmdd10. C :yymmdd10. ;
format A B C yymmdd10.;
datalines;
2019/01/01, 2018/03/13, .
2017/02/02, . , 2017/02/02
2018/11/18, 2018/08/01, 2021/07/02
;
run;
proc print;
run;
proc transpose data=have out=tall(where=(not missing(col1)));
by id;
run;
proc sort;
by id col1;
run;
data tall2;
length type $8;
do until(last.col1);
set tall; by id col1;
date = col1;
type = catx('/',type,_name_);
end;
format date yymmdd10.;
run;
proc print;
run;
proc summary data=tall2 nway;
class id;
output out=want(drop=_type_) idgroup(out[3](date type)=);
run;
proc print;
run;
... View more