TOTAL command

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

Syntax

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

Parameters

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 only executed on records that pass the test.

WHILE test

Optional. Specifies that the command should only be executed while a condition is true. The command processing terminates as soon as the specified test 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

TOTALn

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.

Remarks

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.

Example

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

TOTAL FIELDS MKTVAL FIRST 25


(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback