By default, any statistics you request using TOTAL, MAXIMUM, MINIMUM,
and AVERAGE (as well as BTOTAL, BMINIMUM, BMAXIMUM and BAVERAGE, which
you will learn about later) are displayed for every numeric ON field.
You can use the NOST formatting item to suppress statistics for numeric
fields, such as telephone numbers, for which they are meaningless.
The following DISPLAY operator prints a report from the SORT.BRANCH
data set with totals for the Revenue and Profit fields, but not for
the Employees field.
DISPLAY FROM(IN) LIST(RPT3) -
HEADER('City') ON(1,15,CH) -
HEADER('Employees') ON(18,4,ZD,NOST) -
HEADER('Revenue') ON(22,6,PD) -
HEADER('Profit') ON(28,6,PD) -
TOTAL('Totals')
The RPT3 data set looks like this:
City Employees Revenue Profit
--------------- --------- ---------------- ----------------
Los Angeles 32 22530 -4278
San Francisco 35 42820 6832
Fort Collins 22 12300 -2863
Sacramento 29 42726 8276
Sunnyvale 18 16152 -978
Denver 33 31876 6288
Boulder 32 33866 7351
Morgan Hill 15 18200 3271
Vail 19 23202 5027
San Jose 21 27225 8264
San Diego 22 32940 8275
Aspen 20 25800 5200
Totals 329637 50665