Hello, You can also extract all the variable names with the minimum values: data Before ; input Date ddmmyy10. a b c min ; datalines; 19/08/2014 4 2 3 2 18/08/2014 6 6 7 6 17/08/2014 5 10 6 5 16/08/2014 1 6 6 1 15/08/2014 7 5 10 5 14/08/2014 3 2 2 2 13/08/2014 9 2 5 2 12/08/2014 8 7 8 7 11/08/2014 8 9 3 3 10/08/2014 2 4 3 2 ; data want; set before; length minvar1 $ 6; array intvars{3} $ a b c ; array varx(3) $ _temporary_ ('a' 'b' 'c'); do i=1 to hbound(intvars); if intvars{i}=min then do; put minvar1=; minvar1=cats(minvar1,",",varx{i}); *if you want the first variable with the minimum value just uncomment the following line; *leave; end; end; minvar1=substr(minvar1,2); run;
... View more