IBM Extension

CONSTANT Clause

The CONSTANT clause is used to associate a constant name with a literal. The constant name can then be used in place of a literal. The CONSTANT clause can only be specified for level 01 entries for elementary constant name. The CONSTANT clause can also be defined as another previously defined constant name.

A Constant name needs to be defined in a CONSTANT clause before its use. It can be used in Data Division and Procedure Division where literal or integer is allowed, except in the compiler-directing statements, such as COPY statement and TITLE statement.

Constant-name-1 may be used anywhere that a format specifies a literal of the class and category of constant-name-1. The class and category of constant-name-1 is the same as that of literal-1 or is an integer if LENGTH OF phrase is specified. If constant-name-1 is an integer, it may also be used to specify repetition in a picture string.

Literal-1 cannot be a figurative constant.

If the LENGTH OF phrase is specified, the value of constant-name-1 is determined as specified in the LENGTH intrinsic function with the exception that when data-name-2 is a variable-length data item described with the OCCURS DEPENDING ON clause, the maximum size of the data item is used.

End of IBM Extension