Here are two ways to do it. The first only picks one minimum; the second is a bit more work but will pick multiple. WHICHN() function tells you which argument after the first has the value of the first argument (only tells you the first one, though). For both solutions, VNAME() tells you the variable name of the variable in the array. data have; input date1 date2 date3 date4 date5; informat date1-date5 MMDDYY8.; format date1-date5 DATE9.; datalines; 1/1/12 . 5/7/13 . . . 6/5/12 . 6/5/12 . ;;;; run; data want; set have; array dates date1-date5; format minDateVal $200.; minDate = whichn(min(of dates ),of dates ); if (1 le minDate lt dim(dates)) then minDateVal = vname(dates[mindate]); end; put minDateVal=; run; data want; set have; array dates date1-date5; format minDateVal $200.; do _t = 1 to dim(dates); if dates[_t] = min(of dates ) then minDateVal = catx(',',minDateVal,vname(dates[_t])); end; run;
... View more