Operation code attribute (O')

The operation code attribute (O') can be used in conditional assembly statements to determine if a given operation code has been defined prior to the attribute reference. The following letters are used for the operation code attribute value:
A
Assembler operation codes
E
Extended mnemonic operation codes
M
Macro operation codes
O
Machine operation codes
S
Macro found in SYSLIB (z/OS® and CMS) or library (by Librarian on z/VSE®)
U
Undefined operation codes

If an operation code is redefined using the OPSYN instruction the attribute value represents the new operation code type. If the operation code is deleted using the OPSYN instruction the attribute value is ‘U’.

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

&CHECKIT  SETC           O'MYMAC
          AIF            ('&CHECKIT' EQ 'U').NOMAC
          MYMAC
.NOMAC    ANOP
          ⋮
DATAAREA  DC             F'0'