11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

&SYSNDX System Variable SymbolStatement 8 is the 108th macro instruction processed. Therefore, each occurrence of&SYSNDX is replaced by the number 0108. For example, statement 6 is used tocreate the unique name B0108.When statement 5 is used to process the 108th macro instruction, statement 5becomes the 109th macro instruction processed. Therefore, each occurrence of&SYSNDX is replaced by the number 0109. For example, statement 1 is used tocreate the unique name A0109.&SYSNEST System Variable SymbolUse &SYSNEST to obtain the current macro instruction nesting level.The local-scope system variable symbol &SYSNEST is assigned a read-only valueeach time a macro definition is called from a source module.The value assigned to &SYSNEST is a number from 1 to 99999999. No leadingzeros 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 iscalled by an inner macro instruction, the value assigned to &SYSNEXT isincremented by 1. Each time an inner macro exits, the value is decremented by 1.Notes:1. The value of the type attribute of &SYSNEST (T'&SYSNEST) is always N.2. The value of the count attribute (K'&SYSNEST) is equal to the number of digitsassigned.The following example shows the values assigned to &SYSNEST:MACROOUTERDC A(&SYSNEST) Statement 1INNER1 Statement 2INNER2 Statement 3MENDMACROINNER1DC A(&SYSNEST) Statement 4INNER2 Statement 5MENDMACROINNER2DC A(&SYSNEST) Statement 6MEND--------------------------------------------------------------------OUTER Statement 7+ DC A(1)+ DC A(2)+ DC A(3)+ DC A(2)Statement 7 is in open code. It calls the macro OUTER. &SYSNEST is assigned avalue of 1 which is substituted in statement 1.Statement 2, within the macro definition of OUTER, calls macro INNER1. The valueassigned to &SYSNEST is incremented by 1. The value 2 is substituted for&SYSNEST in statement 4.280 <strong>HLASM</strong>: <strong>V1R6</strong> <strong>Language</strong> <strong>Ref</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!