Often in reporting we do the same thing to several variables - print them, calculate statistics, etc. For example, in the hypothetical store scenario we might sum the number of shipments, the number of returns, the amount of inventory cost.
I propose an enhancement to base SAS to allow definition of a named group of variables that can then be used everywhere and be expanded into that list of variables. This would make some programs a lot "cleaner" and save time writing programs.
DATA My_DATA(KEEP=Store Store_Variables);
GROUP Store_Variables Shipments, Returns, Inventory_Cost, Sales;
PROC SORT DATA=My_DATA; By Store;
PROC MEANS DATA=My_DATA; By Store;
OUTPUT OUT=Store_Summary; SUM=Store_Variables;
Store_Summary should then contain Store Shipments Returns Inventory_Cost Sales which are sums of the input data variables of those names.
For discussion: should the named group be carried forward if all of its constituent variables exist in the summary? Should PROCs instead support naming groups for output variables? Should GROUP be a dataset option instead of a DATA step statement?