7.83.1 KEEP_MAX Parameters
Specifies from 1 to 50 fields that are to be scanned for the maximum value by the KEEP_MAX 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.
Specifies the field that is to hold the value of the field having the maximum value 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.
Specifies the condition under which the fields are to be scanned for the maximum value.
*SELECTED, which is the default value indicates, that the scanning for maximum value 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 scanning for maximum value 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 scan for maximum value cycle is started.
The "accumulator" is the work field keeping track of the maximum value.
See the examples section for more details of how this parameter is used.