22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Macro Instruction Format<br />

Operand Entry<br />

You can use a variable symbol as a macro instruction. For example if MAC1 has<br />

been defined as a macro, you can use the following statements to call it:<br />

&CALL SETC 'MAC1'<br />

&CALL<br />

You cannot use a variable symbol as a macro instruction that passes operands to<br />

the macro. The second statement in the following example generates an error:<br />

&CALL SETC 'MAC1 OPERAND1=VALUE'<br />

&CALL<br />

You must specify operand entries after the variable symbol, as shown in the<br />

following example:<br />

&CALL SETC 'MAC1'<br />

&CALL OPERAND1=VALUE<br />

Use the operand entry of a macro instruction to pass values into the called macro<br />

definition. These values can be passed through:<br />

The symbolic parameters you have specified in the macro prototype, or<br />

The system variable symbol &SYSLIST if it is specified in the body of the<br />

macro definition (see “&SYSLIST System Variable Symbol” on page 276).<br />

The two types of operands allowed in a macro instruction are positional and<br />

keyword operands. You can specify a sublist with multiple values in both types of<br />

operands. Special rules for the various values you can specify in operands are<br />

also given below.<br />

Positional Operands<br />

You can use a positional operand to pass a value into a macro definition through<br />

the corresponding positional parameter declared for the definition. You should<br />

declare a positional parameter in a macro definition when you want to change the<br />

value passed at every call to that macro definition.<br />

You can also use a positional operand to pass a value to the system variable<br />

symbol &SYSLIST. If &SYSLIST, with the applicable subscripts, is specified in a<br />

macro definition, you do not need to declare positional parameters in the prototype<br />

statement of the macro definition. You can thus use &SYSLIST to refer to any<br />

positional operand. This allows you to vary the number of operands you specify<br />

each time you call the same macro definition.<br />

The positional operands of a macro instruction must be specified in the same order<br />

as the positional parameters declared in the called macro definition.<br />

Each positional operand constitutes a character string. This character string is the<br />

value passed through a positional parameter into a macro definition.<br />

The specification for each positional parameter in the prototype statement definition<br />

must be a valid variable symbol. Values are assigned (see ▌1▐ in Figure 77 on<br />

page 301) to the positional operands by the corresponding positional arguments<br />

(see ▌2▐ in Figure 77) specified in the macro instruction that calls the macro<br />

definition.<br />

300 <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!