Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
&SYSNEST System Variable Symbol HLASM Language Reference SC26-4940-06 |
|
Use &SYSNEST to obtain the current macro instruction nesting level. The local-scope system variable symbol &SYSNEST is assigned a read-only value each time a macro definition is called from a source module. The value assigned to &SYSNEST is a number from 1 to 99999999.
No leading zeros are generated as part of the number. When a macro
is called from open code, the value assigned to &SYSNEST is the
number 1. Each time a macro definition is called by an inner macro
instruction, the value assigned to &SYSNEXT is incremented by
1. Each time an inner macro exits, the value is decremented by 1.
Notes:
The following example shows the values assigned to &SYSNEST:
Statement 7 is in open code. It calls the macro OUTER. &SYSNEST is assigned a value of 1 which is substituted in statement 1. Statement 2, within the macro definition of OUTER, calls macro INNER1. The value assigned to &SYSNEST is incremented by 1. The value 2 is substituted for &SYSNEST in statement 4. Statement 5, within the macro definition of INNER1, calls macro INNER2. The value assigned to &SYSNEST is incremented by 1. The value 3 is substituted for &SYSNEST in statement 6. When the macro INNER2 exits, the value assigned to &SYSNEST is decremented by 1. The value of &SYNEST is 2. When the macro INNER1 exits, the value assigned to &SYSNEST is decremented by 1. The value of &SYSNEST is 1. Statement 3, within the macro definition of OUTER, calls macro INNER2. The value assigned to &SYSNEST is incremented by 1. The value 2 is substituted for &SYSNEST in statement 6. |
Copyright IBM Corporation 1990, 2014
|