Special characters

Any of the 256 characters of the EBCDIC character set can appear in the value of a macro instruction operand (or sublist entry). However, the following characters require special consideration:

Ampersands

A single ampersand indicates the presence of a variable symbol. The assembler substitutes the value of the variable symbol into the character string specified in a macro instruction operand. The resultant string is then the value passed into the macro definition. If the variable symbol is undefined, an error message is issued.

Double ampersands must be specified if a single ampersand is to be passed to the macro definition.

Examples:

&VAR
&A+&B+3+&C*10
'&MESSAGE'
&&REGISTER

Single quotation marks

A single quotation mark is used:

Examples:

'QUOTED STRING'
L'SYMBOL
T'SYMBOL

Shift-out (SO) and shift-in (SI)

If the DBCS assembler option is specified, then SO (X'0E') and SI (X'0F') are recognized as shift codes. SO and SI delimit the start and end of double-byte data respectively.

Quoted strings and character strings

A "quoted string" is any sequence of characters that begins and ends with a single quotation mark (compare with conditional assembly character expressions described in Character (SETC) expressions).

Two single quotation marks must be specified inside each quoted string. This includes substituted single quotation marks.

A "character string" is a sequence of characters, not delimited with quotes. So a character string is the contents of a quoted string.

Quoted strings can contain double-byte data, if the DBCS assembler option is specified. The double-byte data must be bracketed by the SO and SI delimiters. Only valid double-byte data is recognized between the SO and SI. The SI may be in any odd-numbered byte position after the SO. If the end of the operand is reached before SI is found, then error ASMA203E Unbalanced double-byte delimiters is issued.

Macro instruction operands can have values that include one or more quoted strings. Each quoted string can be separated from the following quoted string by one or more characters, and each must contain an even number of single quotation marks.

Examples:

''
'L''SYMBOL'
'QUOTE1'AND'QUOTE2'
A'B'C

Attribute reference notation

You can specify an attribute reference notation as a macro instruction operand value. The attribute reference notation must be preceded by a space or any other special character except the ampersand and the single quotation mark. See Data attributes for details about data attributes, and the format of attribute references.

Examples:

          MAC1           L'SYMBOL,10+L'AREA*L'FIELD
          MAC1           I'PACKED-S'PACKED

Parentheses

In macro instruction operand values, there must be an equal number of left and right parentheses. They must be paired, that is, each left parenthesis needs a following right parenthesis at the same level of nesting. An unpaired (single) left or right parenthesis can appear only in a quoted string.

Examples:

(PAIRED-PARENTHESES)
()
(A(B)C)D(E)
(IN'('STRING)

Spaces

One or more spaces outside a quoted string indicates the end of the operands of a macro instruction. Thus spaces should only be used inside quoted strings.

Example:

'SPACES ALLOWED'

Commas

A comma outside a quoted string indicates the end of an operand value or sublist entry. Commas that do not delimit values can appear inside quoted strings or paired parentheses that do not enclose sublists.

Examples:

A,B,C,D
(1,2)3'5,6'

Equal signs

An equal sign can appear in the value of a macro instruction operand or sublist entry:

Examples:

=H'201'
A'='B
C(A=B)
2X=B
KEY=A=B

The assembler issues a warning message for a positional operand containing an equal sign, if the operand resembles a keyword operand. Thus, if we assume that the following is the prototype of a macro definition:

          MAC1           &F

the following macro instruction generates a warning message:

          MAC1           K=L  (K appears to be a valid keyword)

while the following macro instruction does not:

          MAC1           2+2=4  (2+2 is not a valid keyword)

Periods

A period (.) can be used in the value of an operand or sublist entry. It is passed as a period. However, if it is used immediately after a variable symbol, it becomes a concatenation character. Two periods are required if one is to be passed as a character.

Examples:

3.4
&A.1
&A..1

[ Top of Page | Previous Page | Next Page | Contents | Index ]