Use &SYSECT in a macro definition to generate the name of the current control section. The current control section is the control section in which the macro instruction that calls the definition appears. You can't use &SYSECT in open code.
The local-scope system variable symbol &SYSECT is assigned a read-only value each time a macro definition is called.
The value assigned is the symbol that represents the name of the current control section from which the macro definition is called. Note that it is the control section in effect when the macro is called. A control section that has been initiated or continued by substitution does not affect the value of &SYSECT for the expansion of the current macro. However, it may affect &SYSECT for a subsequent macro call. Nested macros cause the assembler to assign a value to &SYSECT that depends on the control section in force inside the outer macro when the inner macro is called.
The next example shows these rules:
MACRO
INNER &INCSECT
&INCSECT CSECT Statement 1
DC A(&SYSECT) Statement 2
MEND
MACRO
OUTER1
CSOUT1 CSECT Statement 3
DS 100C
INNER INA Statement 4
INNER INB Statement 5
DC A(&SYSECT) Statement 6
MEND
MACRO
OUTER2
DC A(&SYSECT) Statement 7
MEND
-------------------------------------------------------------------
MAINPROG CSECT Statement 8
DS 200C
OUTER1 Statement 9
OUTER2 Statement 10
-------------------------------------------------------------------
Generated Program
-------------------------------------------------------------------
MAINPROG CSECT
DS 200C
CSOUT1 CSECT
DS 100C
INA CSECT
DC A(CSOUT1)
INB CSECT
DC A(INA)
DC A(MAINPROG)
DC A(INB)
In this example:
[ Top of Page | Previous Page | Next Page | Contents | Index ]