Sublists in operands
You can use a sublist in a positional or keyword operand to specify several values. A sublist is a character string that consists of one or more entries separated by commas and enclosed in parentheses.
If the COMPAT(SYSLIST) assembler option is not specified, a variable symbol that has been assigned a character string that consists of one or more entries separated by commas and enclosed in parentheses is also treated as a sublist. However, if the COMPAT(SYSLIST) assembler option is specified, a sublist assigned to a variable symbol is treated as a character string, not as a sublist.
MAC1
.
In the first call, the value of the operand in variable &VAR1
is
treated as a sublist. In the second call, the value of the operand
is treated as a character string, not a sublist, because the variable &VAR2
does
not include parentheses. &VAR1 SETC '(1,2)'
MAC1 KEY=&VAR1
&VAR2 SETC '1,2'
MAC1 KEY=(&VAR2)
- The corresponding symbolic parameter with an applicable subscript.
- The system variable symbol &SYSLIST with applicable subscripts, the first of which refers to the positional operand, and the second to the sublist entry in the operand. &SYSLIST can refer only to sublists in positional operands.
Figure 1 shows that the value specified in a positional or keyword operand can be a sublist.
A symbolic parameter can refer to the whole sublist (see 1 in Figure 1), or to an individual entry of the sublist. To refer to an individual entry, the symbolic parameter (see 2 in Figure 1) must have a subscript whose value indicates the position (see 3 in Figure 1) of the entry in the sublist. The subscript must have a value greater than or equal to 1.
(A,B,C,D,E)
.
()
is a valid sublist with the null character string as the only entry. 
&SYSLIST(n,m): The system variable symbol, &SYSLIST(n,m), can also refer to sublist entries, but only if the sublist is specified in a positional operand.
Parameter | Sublist specified in
corresponding operand or as default value of a keyword parameter |
Value generated or used in computation |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notes:
|