Tips for using Accumulators A1 - A4 in ACL Programs.
search cancel

Tips for using Accumulators A1 - A4 in ACL Programs.

book

Article ID: 9537

calendar_today

Updated On:

Products

Teleview TELEVIEW- PACKAGE TPX - Session Management Vman Session Management for z/OS

Issue/Introduction

This document describes Accumulators and their benefits for ACL/E programming. These Accumulators are predefined variables which allow you to do basich arithmetic in ACL/E. How they can be used is explained in this article.



Environment

Release: NVINAM00200-5.3-TPX-Session Management-Access Management package
Component:

Resolution

ACL provides four predefined numeric variables called Accumulators. The names of these variables are A1, A2, A3 and A4. Accumulators are mainly used for loop counters e.g. when reading the lines of a screen into variables etc.

They have the following features:

  1. The scope of the Accumulator is limited to the ACL in which they are used. There is no need to define them using a VDEFINE Statement. Valid values in Accumulators are any integers between 0 and 16777215 (=2^24-1).

  2. When used in COMPARE, ADD or SUB, the value of an accumulator is referenced without the '&' otherwise it is interpreted as an implicit defined variable.

  3. When the value of an accumulator is displayed, the accumulator need to be prefixed by an '&' like every other variable:
    OUTPUT 'The Value of A1 = &A1',7/6

  4. Take care that the value in the accumulator does not go negative. Otherwise results are unpredictable.

  5. You even can multiply and divide with Accumulators. Please refer to Knowledge Document TEC461929 for details.

    Here are the possible functions which can be executed using accumulators:

    SET      An,integer 
    ADD An,An
    ADD An,integer
    SUB An,An
    SUB An,integer
    COMPARE An,An
    COMPARE An,integer