Using the APIs in a Program
You can use the aggregate range routines whenever you would otherwise use E@DBFINDSUBRNG and E@DBFINDPRVRNG to access a set of rows for the purpose of applying average, maximum, minimum, or sum functions against a column.
Use the U@DB@AGINIT routine to initialize an aggregation request.
Use the E@DBCALCAGGRGT routine to process an aggregation request against a data set.
The database routines perform an equal condition on all D@ Index fields up to the subrange field designated in the E@DBSUBRNG. It performs a "where greater-than and less-than" condition on this index field.