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


General rules and restrictions

HLASM Language Reference
SC26-4940-06

Macro instruction statements can be written inside macro definitions. Values are substituted in the same way as they are for the model statements of the containing macro definition. The assembler processes the called macro definition, passing to it the operand values (after substitution) from the inner macro instruction. In addition to the operand values described in Values in operands, nested macro calls can specify values that include:
  • Any of the symbolic parameters (see  1  in Figure 1) specified in the prototype statement of the containing macro definition
  • Any SET symbols (see  2  in Figure 1) declared in the containing macro definition
  • Any of the system variable symbols, such as &SYSDATE or &SYSTIME, (see  3  in Figure 1).
Figure 1. Values in nested macro calls
                               ┌──────────── Parameters
                               │
         MACRO        ┌────────┴────────┐
         OUTERMAC     &P1,&P2,&KEY1=VALUE    Prototype
         .             │
         .             1 
         .             │
         LCLC  &C──────────────> 2 
         .             │         │
         .             │         │
&C       SETC  'ABC'   │         │
         .             │         │
         .             V         V
         INNERMAC     &P1,&KEY1,&C           Inner macro call
         .            └─────┬────┘
         .                  └─────────────── Operands
         .
         MEND
─────────────────────────────────────────────────────────────────────
         MACRO
         OUT                                 Prototype
         .
         .
         .      3           3        3 
         IN    &SYSLIST(3),&SYSECT,A&SYSDNX  Inner macro call
         .
         .
         MEND

The number of nesting levels permitted depends on the complexity and size of the macros at the different levels; that is, the number of operands specified, the number of local-scope and global-scope SET symbols declared, and the number of sequence symbols used.

When the assembler processes a macro exit instruction, either MEXIT or MEND, it selects the next statement to process depending on the level of nesting. If the macro exit instruction is from an inner macro, the assembler processes the next statement after the statement that called the outer macro. The next statement in open code might come from the AINSERT buffer. If the macro exit instruction is from an outer macro, the assembler processes the next statement in open code, after the statement that called the outer macro.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014