Example of suffixed variables with an undetermined range
    

The following macro, ORSTATS, takes a list of columns and calculates three rowwise order statistics, the minimum, median, and maximum.

MACRO
ORSTATS X.1-X.N MIN MED MAX
#
# Input consists of a list of columns X.1-X.N.
# The rowwise minimums, medians, and maximums are calculated and
# stored in MIN, MED, and MAX respectively.
#
MCOLUMN X.1-X.N MIN MED MAX
#
RMIN X.1-X.N MIN
RMED X.1-X.N MED
RMAX X.1-X.N MAX
ENDMACRO

Suppose we want to calculate the same statistics for eight columns, C5-C13, and store them in C21, C22, and C23. When invoking the macro, we would type %ORSTATS C5-C13 C21-C23.

By matching arguments on this line with the template in the macro program, Minitab determines that N = 8. Then Minitab matches C5 to X.1, C6 to X.2, ... , C13 to X.8 and C21 to MIN, C22 to MED, and C23 to MAX.