HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Computed AGO instruction

HLASM Language Reference
SC26-4940-06

The computed AGO instruction makes branches according to the value of an arithmetic expression specified in the operand.
Read syntax diagramSkip visual syntax diagram
>>-+-----------------+--AGO------------------------------------->
   '-sequence_symbol-'        

                           .-,---------------.   
                           V                 |   
>--(arithmetic_expression)---sequence_symbol-+-----------------><

sequence_symbol
Is a sequence symbol.
arithmetic_expression
Is an arithmetic expression the assembler evaluates to k, where k is 1 - n (the number of occurrences of sequence_symbol in the operand field). The assembler branches to the k-th sequence symbol in the list. If k is outside that range, no branch is taken.
In the following example, control passes to the statement at .THIRD if &I= 3. Control passes through to the statement following the AGO if &I is less than 1 or greater than 4.
                                                               Cont.
         AGO             (&I).FIRST,.SECOND,                     X
                         .THIRD,.FOURTH

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014