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


Extended AIF instruction

HLASM Language Reference
SC26-4940-06

The extended AIF instruction combines several successive AIF statements into one statement.
Read syntax diagramSkip visual syntax diagram
>>-+-----------------+--AIF------------------------------------->
   '-sequence_symbol-'        

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

sequence_symbol
Is a sequence symbol
logical_expression
Is a logical expression the assembler evaluates during conditional assembly time to determine if it is true or false. If the expression is true (logical value=1), the statement named by the sequence symbol in the operand field is the next statement processed by the assembler. If the expression is false (logical value=0), the next logical expression is evaluated.

The extended AIF instruction is exactly equivalent to n successive AIF statements. The branch is taken to the first sequence symbol (scanning left to right) whose corresponding logical expression is true. If none of the logical expressions is true, no branch is taken.

Example:
                                                                Cont.
         AIF             ('&L'(&C,1) EQ '$').DOLR,                X
                         ('&L'(&C,1) EQ '#').POUND,               X
                         ('&L'(&C,1) EQ '@').AT,                  X
                         ('&L'(&C,1) EQ '=').EQUAL,               X
                         ('&L'(&C,1) EQ '(').LEFTPAR,             X
                         ('&L'(&C,1) EQ '+').PLUS,                X
                         ('&L'(&C,1) EQ '-').MINUS

This statement looks for the occurrence of a $, #, @, =, (, +, and -, in that order; and causes control to branch to .DOLR, .POUND, .AT, .EQUAL, .LEFTPAR, .PLUS, and .MINUS, if the string being examined contains any of these characters at the position designated by &C.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014