Previous Topic Next topic Print topic


The USAGE Clause

The USAGE clause supports the following RM/COBOL behavior in this COBOL system.

General Formats for Format 1

The following formats of the USAGE clause are supported:

The USAGE Clause

General Formats for Format 2

The following formats of the USAGE clause are supported:

The USAGE Clause

General Syntax Rules

  1. COMP and COMPUTATIONAL are synonymous.
  2. COMP-1 and COMPUTATIONAL-1 are synonymous.
  3. COMP-3 and COMPUTATIONAL-3 are synonymous.
  4. COMP-4 and COMPUTATIONAL-4 are synonymous.
  5. COMP-5 and COMPUTATIONAL-5 are synonymous.
  6. COMP-6 and COMPUTATIONAL-6 are synonymous.
  7. The USAGE clause may be written at any level. If the USAGE clause is written at a group level, it applies to each elementary item in the group. The USAGE clause of an elementary item cannot contradict the USAGE clause of a group to which the item belongs. When the usage is COMPUTATIONAL-4, COMP-4, COMPUTATIONAL-5, COMP-5 or BINARY, the binary allocation override may also be included or omitted at any level as part of a USAGE clause at that level. If included, the binary allocation override may specify a different value than that specified in the USAGE clause for a containing group. The rules for the binary allocation override within group structure are as follows:

    • If the USAGE clause is written at a group level and specifies COMPUTATIONAL-4, COMP-4, COMPUTATIONAL-5, COMP-5, or BINARY usage with the allocation override n specified in parentheses following the usage type, the allocation override n applies to each elementary item in the group that does not specify a USAGE clause and is not subordinate to another group with a higher level-number that specifies a USAGE clause.
    • If the USAGE clause is written at a group level and specifies COMPUTATIONAL-4, COMP-4, COMPUTATIONAL-5, COMP-5, or BINARY usage without the allocation override n, the configured binary allocation scheme applies to each elementary item in the group that does not specify a USAGE clause and is not subordinate to another group with a higher level-number that specifies a USAGE clause.

Syntax Rules for Format 2

  1. n specifies the number of bytes allocated to the data item. The value of n must not be less than 1 or greater than 16.

General Rules

  1. Compile your programs with the DIALECT"RM" Compiler directive to emulate RM/COBOL behavior for these data types in this COBOL system.
Previous Topic Next topic Print topic