Here's one possibility on how to deal with ties. It assumes that you could have a constant value for your "var" array, so all would be ties. data have;
format date1 - date5 date9.;
informat date1 - date5 date9.;
input var1 - var5 date1 - date5;
datalines;
1 3 0 4 5 01JAN2017 02JAN2017 03JAN2017 04JAN2017 05JAN2017
1 3 0 0 5 01JAN2017 02JAN2017 03JAN2017 04JAN2017 05JAN2017
0 3 0 4 5 01JAN2017 02JAN2017 03JAN2017 04JAN2017 05JAN2017
;
data want;
set have;
array var{*} var:;
array date{*} date:;
/* With no ties, this is an ideal solution. */
reeza = date(whichn(min(of var(*)), of var(*)));
array match{5} match1 - match5;
do i = 1 to 5;
if var(i) = min(of var(*)) then match(i) = date(i);
end;
/* This sorts the matches ascending, so . comes first. */
call sortn(of match{*});
/* This reverses the sort, so you end up with desceding sort. */
array rev{*} match5 - match1;
call sortn(of rev{*});
format reeza match1 - match5 date9.;
/* Drop extraneous variables as as necessary... */
run;
... View more