Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

DEFINE directive

The DEFINE directive defines a symbolic name for numeric literals or string literals which are used in an IF directive, an EVALUATE directive or the constant definition of a DEFINE directive.

Format


>>DEFINE compilation-variable-name AS {{arithmetical-expression | literal | PARAMETER} [OVERRIDE] | OFF}


Syntax rules

  1. If neither the OFF nor the OVERRIDE phrase is used, one of the following conditions must apply:

    • compilation-variable-name must not yet be defined within the compilation group.

    • The last preceding DEFINE directive that refers to compilation-variable-name must specify the same value as the OFF clause.

  2. literal may be an integer numeric literal or a non-hexadecimal alphanumerical literal (see section "Literals"). The length of such a string literal is limited by the space available in a line.

  3. arithmetical-expression must be formed as described on "Compiler directives".

General rules

  1. The DEFINE directive is processed concurrently with the execution of the COPY and REPLACE statement.

  2. The defined compilation variables may only be used in other directives in place of literals, but not in program text.

  3. The OVERRIDE phrase can be used to define a new value for compilation-variable-name and ignore any previous value.

  4. The PARAMETER phrase passes the value of the compilation variable to the compiler at start time (see the "COBOL2000 User Guide" [1]).

  5. If OFF is specified or if an error occurs when the associated compilation variable is passed then compilation-variable-name has the status “undefined”.