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


Operation code attribute (O')

HLASM Language Reference
SC26-4940-06

The operation code attribute shows whether a given operation code has been defined prior to the attribute reference. The operation code can be represented by a character string or by a variable symbol containing a character string. The variable must be set using a SETC assembler instruction prior to being referenced by the operation code (O') attribute.

The operation code attribute has a value of a single alphabetic character that shows the type of operation represented.

This attribute reference can be used in the operand field of the SETC instruction or as one of the values used in the operand field of a SETB or AIF instruction.

The following letters are used for the value of the operation code attribute:
A
Assembler operation code
E
Extended mnemonic operation code
M
Macro definition
O
Machine operation code
S
Macro definition found in library
U
Undefined, unknown, unassigned, or deleted operation code
Notes:
  1. The operation code (O') attribute can only be used in a conditional assembly statement.
  2. The assembler does not enter lookahead mode to resolve the operation code type, therefore only operation codes defined at the time the attribute is referenced return an operation code type value other than U.
  3. When the operation code is not an assembler instruction or a machine instruction, and the operation code is not a previously defined macro, then all libraries in the library data set definition list are searched. This might have an adverse impact on the performance of the assembly, depending on the number of libraries assigned in the assembly job and the number of times the operation code attribute is used.
Examples:
Name      Operation      Operand

&A        SETC           O'MVC
&A contains the letter O, because MVC is a machine operation code:
Name      Operation      Operand

&A        SETC           'DROP'
&B        SETC           O'&A

&B contains the letter A, because DROP is an assembler operation code.

The following example checks to see if the macro MAC1 is defined. If not, the MAC1 macro instruction is bypassed. This prevents the assembly from failing when the macro is not available.
Name      Operation      Operand

&CHECKIT  SETC           O'MAC1
          AIF            ('&CHECKIT' EQ 'U').NOMAC
          MAC1
.NOMAC    ANOP
          .

Redefined Operation Codes: If an operation code is redefined using the OPSYN instruction then the value returned by a subsequent operation code attribute reference represents the new operation code. If the operation code is deleted using the OPSYN instruction then the value returned is U.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014