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


Defined attribute (D')

HLASM Language Reference
SC26-4940-06

The defined attribute shows whether the ordinary symbol or literal referenced has been defined prior to the attribute reference. A symbol is defined if it has been encountered in the operand field of an EXTRN or WXTRN statement, or in the name field of any other statement except a TITLE statement or a macro instruction. A literal is defined if it has been encountered in the operand field of a machine instruction. The value of the defined attribute is an arithmetic value that can be assigned to a SETA symbol, and is equal to 1 if the symbol has been defined, or 0 if the symbol has not been defined.

The defined attribute can reference:
  • Ordinary symbols not constructed by substitution
  • Macro instruction operands
  • SETC symbols whose value is an ordinary symbol
  • System variable symbols whose value is an ordinary symbol
  • Literals
Here is an example of how you can use the defined attribute:
Name      Operation      Operand

          AIF            (D'A).AROUND
A         LA             1,4
.AROUND   ANOP
In this example, assuming there has been no previous definition of the symbol A, the statement labeled A is assembled, since the conditional-assembly branch around it is not taken. However, if by an AGO or AIF conditional-assembly branch the same statement is processed again, the statement at A is not assembled:
Name      Operation      Operand

.UP       AIF            (D'A).AROUND
A         LA             1,4
.AROUND   ANOP
          .
          .
          AGO            .UP

You can save assembly time using the defined attribute which avoids lookahead mode (see Lookahead for more information). You can use the defined attribute in your program to prevent the assembler from making this time-consuming forward scan. This attribute reference can be used in the operand field of a SETA instruction or as one of the values in the operand field of a SETB or AIF instruction.

Notes:
  1. D' applied to a SETA or SETB symbol, or to a system variable symbol, is an error.
  2. D' applied to a SETC symbol or symbolic parameter is valid only if the value of the SETC symbol or symbolic parameter is a valid ordinary symbol or literal.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014