Use &SYSLIST instead of a positional parameter inside a macro definition; for example, as a point of substitution. By varying the subscripts attached to &SYSLIST, you can refer to any sublist entry in a macro call operand, or any positional operands in a macro call. You can also refer to positional operands for which no corresponding positional parameter is specified in the macro prototype statement.
The local-scope system variable symbol &SYSLIST is assigned a read-only value each time a macro definition is called.
&SYSLIST refers to the complete list of positional operands specified in a macro instruction. &SYSLIST does not refer to keyword operands. However, &SYSLIST cannot be specified as &SYSLIST without a subscript. One of the two following forms must be used for references or as a point of substitution:
The subscripts n and m can be any arithmetic expression allowed in the operand of a SETA instruction (See SETA instruction). The subscript n must be greater than or equal to 0. The subscript m and any additional subscripts after m must be greater than or equal to 1.
The examples below show the values assigned to &SYSLIST according to the value of its subscripts n and m.
Macro instruction:
------------------
NAME MACALL ONE,TWO,(3,(4,5,6),,8),,TEN,()
Use Within a
Macro Definition: Value See note:
--------------------- ------------ ---------
&SYSLIST(2) TWO
&SYSLIST(3,1) 3
&SYSLIST(3,2,2) 5
&SYSLIST(4) Null 1
&SYSLIST(12) Null 1
&SYSLIST(3,3) Null 2
&SYSLIST(3,5) Null 2
&SYSLIST(2,1) TWO 3
&SYSLIST(2,2) Null
&SYSLIST(0) NAME 4
&SYSLIST(3) (3,(4,5,6),,8)
&SYSLIST(11) ()
&SYSLIST(11,1) Null 2
Attribute references can be made to the previously described forms of &SYSLIST. The attributes are the attributes inherent in the positional operands or sublist entries to which you refer. However, the number attribute of &SYSLIST (N'&SYSLIST) is different from the number attribute described in Data attributes. One of two forms can be used for the number attribute:
The COMPAT(SYSLIST) assembler option instructs the assembler to treat sublists in macro instruction operands as character strings, not sublists. See the section "COMPAT" in the HLASM Programmer's Guide for a description of the COMPAT(SYSLIST) assembler option.
Examples of sublists:
Macro Instruction N'&SYSLIST
MACLST 1,2,3,4 4
MACLST A,B,,D,E 5
MACLST ,A,B,C,D 5
MACLST (A,B,C),(D,E,F) 2
MACLST 0
MACLST KEY1=A,KEY2=B 0
MACLST A,B,KEY1=C 2
N'&SYSLIST(2)
MACSUB A,(1,2,3,4,5),B 5
MACSUB A,(1,,3,,5),B 5
MACSUB A,(,2,3,4,5),B 5
MACSUB A,B,C 1
MACSUB A,,C 0
MACSUB A,(),C 1
MACSUB A,KEY=(A,B,C) 0
MACSUB 0
[ Top of Page | Previous Page | Next Page | Contents | Index ]