TOTAL command

Used to calculate the total value of the specified fields in an ACL table.


TOTAL {<FIELDS> numeric_field <...n>|ALL} <IF test> <WHILE test>
<{FIRST|NEXT} range>


FIELDS numeric_field | ALL

Specify one or more numeric fields to total, or specify ALL to total each of the numeric fields in the table.

IF test

Optional. Specifies a condition that must be met. The command is executed on only those records that meet the condition.

WHILE test

Optional. Specifies that the command is executed only while a condition is true. The command processing terminates as soon as the specified condition evaluates as false, or the end of the table is reached.

FIRST | NEXT range

Optional. Specify FIRST to start processing at the first record or NEXT to start processing at the currently selected record. Use the range value to specify the number of records to process.

ACL output variables


Stores the first total value calculated by the command. The value of n is 1 unless the TOTAL command is inside a GROUP command, in which case value of n corresponds to the line number of the TOTAL command in the GROUP command.


You can use the TOTAL command to verify the completeness and accuracy of the source data and to produce control totals. The command calculates the arithmetic sum of the specified fields or expressions.


The following example calculates the total amount of the MKTVAL field for the first 25 records in the table.


(C) 2015 ACL Services Ltd. All Rights Reserved.