Hi,
Why not putting your variables in an array, sort the array and automatically you will have an easy access to the highest value, second highest, lowest, etc ...
There is an experimental array sorting function in SAS 9, try the example below.
Good luck,
Otto.
data t;
infile cards;
input var bar nar kar lar ; * just some variable names ;
cards;
1 8 2 77 13
5 3 1 4 6
;
run;
data tt;
set t;
array v
var bar nar kar lar ;
call sortn (of v);
run;