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.

MACRO<br />

&NAME MOVE &TO,&FROM<br />

LCLC<br />

&PREFIX<br />

&PREFIX SETC '&TO'(1,5) Statement 1<br />

&NAME ST 2,SAVEAREA<br />

L 2,&PREFIX&FROM Statement 2<br />

ST<br />

2,&TO<br />

L<br />

2,SAVEAREA<br />

MEND<br />

-------------------------------------------------------------------<br />

HERE MOVE FIELDA,B<br />

-------------------------------------------------------------------<br />

+HERE ST<br />

2,SAVEAREA<br />

+ L 2,FIELDB<br />

+ ST 2,FIELDA<br />

+ L 2,SAVEAREA<br />

Statement 1 assigns the substring character value FIELD (the first five characters<br />

corresponding to symbolic parameter &TO to the SETC symbol &PREFIX. Therefore,<br />

FIELD replaces &PREFIX in statement 2.<br />

Notes:<br />

1. If the COMPAT(SYSLIST) assembler option is not specified, you can pass a<br />

sublist into a macro definition by assigning the sublist to a SETC symbol, and<br />

then specifying the SETC symbol as an operand in a macro instruction.<br />

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

assigned to SETC symbols are treated as a character string, not as a sublist.<br />

2. Regardless of the setting of the COMPAT(SYSLIST) assembler option, you can<br />

not pass separate (as opposed to a sublist of) parameters into a macro<br />

definition, by specifying a string of values separated by commas as the<br />

operand of a SETC instruction and then using the SETC symbol as an operand<br />

in the macro instruction. If you attempt to do this, the operand of the SETC<br />

instruction is passed to the macro instruction as one parameter, not as a list of<br />

parameters.<br />

Concatenating Substring Notations and Character Expressions: Substring<br />

notations (see “Substring Notation” on page 371) can be concatenated with<br />

character expressions in the operand field of a SETC instruction. If a substring<br />

notation follows a character expression, the two can be concatenated by placing a<br />

period between the terminating single quotation mark of the character expression<br />

and the opening single quotation mark of the substring notation.<br />

For example, if &ALPHA has been assigned the character value AB%4, and &BETA has<br />

been assigned the character value ABCDEF, the following statement assigns &GAMMA<br />

the character value AB%4BCD:<br />

&GAMMA SETC '&ALPHA'.'&BETA'(2,3)<br />

If a substring notation precedes a character expression or another substring<br />

notation, the two can be concatenated by writing the opening single quotation mark<br />

of the second item immediately after the closing parenthesis of the substring<br />

notation.<br />

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