7 62 1 KEEP_AVG Parameters

LANSA Technical

7.62.1 KEEP_AVG Parameters

BY_FIELD

IN_FIELD

OF_FIELD

OF_FIELD

Specifies from 1 to 50 fields that are to be averaged by the KEEP_AVG command.

Fields specified in this parameter must be defined in the LANSA data dictionary or defined within this function by a DEFINE command. Expandable group expressions are valid in this parameter.

The fields specified must also be numeric.

IN_FIELD

Specifies the field that is to hold the result of the averaging of the field(s) specified in the OF_FIELD parameter.

The field specified in this parameter must be numeric and must be defined in the LANSA data dictionary or defined in this function with a DEFINE command.

This field is reset at the beginning of each SELECT/SELECTLIST loop.

BY_FIELD

Specifies the condition under which the fields are to be averaged.

*SELECTED, which is the default value indicates, that the averaging should continue until the SELECT/SELECTLIST loop terminates (ie: all selected information).

Otherwise, specify a list of 1 to 20 field names (alternatively, enter an expandable group expression). The averaging continues until one or more of the fields in the list changes value. When one or more of the fields changes value the "accumulator".is reset to its null value and a new averaging cycle is started.

The "accumulator" is the work field calculating the average.

See the examples section for more details of how this parameter is used.