TT16
Expanding the Functionality of Min()/Max(): Finding Tied Minimum or Maximum Values and Their Contributing Variables

Kent Nassen, Pfizer Global Research & Development -- Ann Arbor Laboratories
Subra Pilli, Pfizer Global Research & Development -- Ann Arbor Laboratories
Luai Alzoubi, Pfizer Global Research & Development -- Ann Arbor Laboratories

SAS provides functions to find the minimum or maximum within a variable or across a set of variables. But what happens when you need to determine, across several variables in a record, which variable is the minimum or, if there are ties at the minimum valu e, which variables had the tied values? Three SAS macros are presented and compared, which go beyond the functionality of the min() or max() functions by determining the minimum or maximum value or tied values, as well as indicating the source variable(s) that account for the minimum or maximum value(s). Methods demonstrated are arrays, macro loops, and proc sql. These macros were originally developed to produce a derived data set for a clinical Positron Emission Tomography (PET) cardiovascular study where comparisons across regions of the heart were needed and tied minimums or maximums in the data would be handled differently, depending on region(s).