22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sublists in Operands<br />

the order in which the positional operands must appear. Interspersed keyword<br />

parameters and operands (see ▌4▐ in Figure 79) do not affect this order.<br />

▌4▐<br />

┌─────────┴─────────┐<br />

MACRO ▼ ▼<br />

▌1▐ MIX &P1,&KEY1=A,&P2,&P3,&P4,&KEY2=,&P5<br />

. ▌3▐<br />

.<br />

.<br />

MEND<br />

─────────────────────────────────────────────────────────────────<br />

START <br />

.<br />

.<br />

. ▌3▐<br />

▌2▐ MIX KEY1=B,ONE,TWO,THREE,KEY2=33,FOUR,FIVE<br />

. ▲ ▲<br />

. └─────────┬──────────┘<br />

. ▌4▐<br />

END<br />

Figure 79. Combining Positional and Keyword Parameters<br />

&SYSLIST( n): The system variable symbol &SYSLIST(n) refers only to the<br />

positional operands in a macro instruction.<br />

Sublists in Operands<br />

You can use a sublist in a positional or keyword operand to specify several values.<br />

A sublist is a character string that consists of one or more entries separated by<br />

commas and enclosed in parentheses.<br />

If the COMPAT(SYSLIST) assembler option is not specified, a variable symbol that<br />

has been assigned a character string that consists of one or more entries<br />

separated by commas and enclosed in parentheses is also treated as a sublist.<br />

However, if the COMPAT(SYSLIST) assembler option is specified, a sublist<br />

assigned to a variable symbol is treated as a character string, not as a sublist.<br />

A variable symbol is not treated as a sublist if the parentheses are not present.<br />

The following example shows two calls to macro MAC1. In the first call, the value of<br />

the operand in variable &VAR1 is treated as a sublist. In the second call, the value<br />

of the operand is treated as a character string, not a sublist, because the variable<br />

&VAR2 does not include parentheses.<br />

&VAR1 SETC '(1,2)'<br />

MAC1 KEY=&VAR1<br />

&VAR2 SETC '1,2'<br />

MAC1 KEY=(&VAR2)<br />

To refer to an entry of a sublist code, use:<br />

The corresponding symbolic parameter with an applicable subscript, or<br />

The system variable symbol &SYSLIST with applicable subscripts, the first of<br />

which refers to the positional operand, and the second to the sublist entry in<br />

the operand. &SYSLIST can refer only to sublists in positional operands.<br />

304 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!