HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Operand entries

HLASM Language Reference
SC26-4940-06

Operand entries contain zero or more operands that identify and describe data to be acted upon by the instruction, by indicating such information as storage locations, masks, storage area lengths, or types of data. The following rules apply to operands:
  • One or more operands are typically required, depending on the instruction.
  • Operands must be separated by commas. No spaces are allowed between the operands and the commas that separate them.
  • A space normally indicates the end of the operand entry, unless the operand is in apostrophes. This applies to machine, assembler, and macro instructions.
  • A space does not end the operand in some types of SET statement. Spaces that do not end operands are discussed further at:

    There are two examples of operands containing spaces in Figure 1; the last box in Row 3, and the middle box in Row 4.

  • The alternative statement format uses slightly different rules. For more information, see Alternative formats for a macro instruction.
The following instruction is correctly coded:
         LA              R1,4+5              No space
The following instruction appears to be the same, but is not:
         LA              R1,4 + 5            Spaces included
In this example, the embedded space means that the operand finishes after "4". There is no assembler error, but the result is an LA   R1,4, which is possibly not what you intended.
A space inside unquoted parentheses is an error, and leads to a diagnostic. The following instruction is correctly coded:
         DC              CL(L'STRLEN)' '     Space within quotes
The following instruction, with an extra space, is not correct:
         DC              CL(L'STRLEN )' '    Space not within quotes
The following example shows a space enclosed in quotes, as part of a string. This space is properly accounted for:
         MVC             AREA1,=C'This Area' Space inside quotes
In quotes, spaces and parentheses can occur in any quantity and in any order:
         LA              R1,=C'This is OK (isn''t it)'

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014