Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

USAGE clause

Function

The USAGE clause specifies the format in which an elementary item is represented in the computer’s internal storage.

Format

[USAGE IS] {  BINARY
            | COMPUTATIONAL
            | COMP
            | COMPUTATIONAL-1
            | COMP-1
            | COMPUTATIONAL-2
            | COMP-2
            | COMPUTATIONAL-3
            | COMP-3
            | COMPUTATIONAL-4
            | COMP-4
            | COMPUTATIONAL-5
            | COMP-5
            | DISPLAY
            | INDEX
            | NATIONAL
            | OBJECT REFERENCE interface-name-1
                                | [FACTORY OF] ACTIVE-CLASS
                                | [FACTORY OF] class-name-1 [ONLY]
                               ]
            | PACKED-DECIMAL
            | POINTER [TO type-name-1]
            | PROGRAM-POINTER
          }

Syntax rules

  1. COMP is the abbreviation for COMPUTATIONAL.
    COMP-1 is the abbreviation for COMPUTATIONAL-1.
    COMP-2 is the abbreviation for COMPUTATIONAL-2.
    COMP-3 is the abbreviation for COMPUTATIONAL-3.
    COMP-5 is the abbreviation for COMPUTATIONAL-5.

  2. If the USAGE clause is not specified for an elementary item, or for a group item, then:

    1. USAGE NATIONAL is assumed if the explicit or implicit PICTURE character-string contains the character N

    2. USAGE DISPLAY is assumed in all other cases.

  3. For a description of the various categories of data see chapter "Introduction to the COBOL language".

General rules

  1. The USAGE clause may be written at any data description level. If it is specified at group level, it applies to each elementary data item of the group.

  2. The USAGE of an elementary item must not conflict with the USAGE of the group item to which the elementary item belongs.

  3. An elementary item described with USAGE BINARY, COMPUTATIONAL, COMPUTATIONAL-1, COMPUTATIONAL-2, COMPUTATIONAL-3, COMPUTATIONAL-5 or PACKED-DECIMAL represents a value for use in arithmetic operations and must therefore be numeric. If any of these phrases is specified for a group item, it refers only to the elementary items of that group; the group item itself must not be used in arithmetic operations.

  4. The USAGE clause does not affect the use of the data item. Although the specifications for some statements in the procedure division may restrict the USAGE clause of the operands referred to.

  5. The internal representation of the numeric data items is shown in table 17 in section "COMPUTATIONAL-3 phrase or PACKED-DECIMAL phrase".