The macro GENMEDIANS generates five columns of random data, then stores the median of each row in another column. There is one list of 5 columns, X.1, X.2, X.3, X.4, X.5, and a single column, MEDIANS. The variables in a list are always stored together in the worksheet. Notice that a dash abbreviates this list.
MACRO
GENMEDIANS MEDIANS
#
MCOLUMN X.1-X.5 MEDIANS
#
RANDOM 100 X.1-X.5
RMEDIAN X.1-X.5 MEDIANS
ENDMACRO
Suppose you stored this macro in a file called GEN2.MAC, and invoke it with %GENMEDIANS C10. After the macro finishes, the medians would appear in C10.