SET TOT


The SET TOT statement is used to obtain the value of an end-of-range total that was accumulated automatically or using the TOTAL statement. SET TOT retrieves the total value and places it in the destination field. The value is dependant on the current sort level. Refer to the TOTAL statement for additional information.

    ••••• SET TOT  ••• •••••••••••••••••••••• ••• =  ••• •••••••••••••••••••••• •••
    (1)            (2) (3)                    (4)    (5) (6)                    (7)

(1) T/F execution conditions

(5) Source application ID

(2) Destination application ID

(6) Source field name, PDF, or constant

(3) Destination field name or PDF

(7) Source occurrence (constant/index)

(4) Destination occ (constant/index)

 

Using the Statement

SET TOT is used in End-of-Range frames in output and update processes.

The source and destination fields can be the same. In this case, the total for that field is moved from the total area into the current area for that field.

Restrictions

Both the source and destination fields must be numeric.

Execution Errors

If the destination field is not large enough to hold the integer portion of the totaled field, a non-recoverable error occurs, unless overflow processing is present in the event point.

Related Statements

OVERFLOW, TOTAL

Example

In the following example, the value in the WORK CASH RECEIVED work field is placed in the WORK AMOUNT work field.

          SET TOT  TAR WORK AMOUNT                =  TAR WORK CASH RECEIVED