Tips for using Accumulators A1 - A4 in ACL Programs.

Document ID:  TEC475111
Last Modified Date:  06/06/2017
{{active ? 'Hide' : 'Show'}} Technical Document Details

Products

  • CA TPX Session Management for z/OS
  • CA STX Session Management for z/OS
  • CA Teleview Session Management for z/OS
  • CA Vman Session Management for z/OS

Releases

  • CA TPX Session Management for z/OS:Release:5.3
  • CA TPX Session Management for z/OS:Release:5.4

Components

  • CA-TPX for OS/390:TPX
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.

Instructions:

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

Please help us improve!

Will this information enable you to resolve your issue?

Please tell us what we can do better.

{{feedbackText.length ? feedbackText.length : '0'}}/255

{{status}}

Not what you were looking for?

Search Again >

Product Information

Support by Product >

Communities

Join a Community >