Hi Bernhard, The largest function will identify the nth largest value from a set of variables you specify. DATA WANT; SET HAVE; LARGEST = LARGEST(1,X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18,X19,X20,X21,X22,X23,X24,X25); RUN; Which can be consolidated to: DATA WANT; SET HAVE; LARGEST = LARGEST(1,of X1-X25); RUN; You could also use an array to resort the values, that way the value in x5 is always the 5th largest of each observation. DATA TWO; KEEP REORDERED:; SET HAVE; ARRAY X(25); ARRAY REORDERED(25); DO K=1 TO 25; REORDERED(K)=largest(K, OF X1-X25); END; RUN; Regards, Scott
... View more