Previous Topic: Example 2

Next Topic: Example 4


Example 3

DEFINE COUNTER A EQ 0
DEFINE(K) COUNTER B EQ 1
COMPUTE COUNTER A = COUNTER A + 1,
        COUNTER B = B + 1

In this example, both counters are incremented by 1 for each new record. Counter A is reset to zero every time a new record is read. Counter B retains its value and could be used to keep track of a running total controlled by you.