USAGE Clause

The USAGE clause specifies the format in which data is represented in storage. The format may be restricted if certain Procedure Division statements are used.

Read syntax diagramSkip visual syntax diagram
USAGE Clause - Format

>>-+---------------+--+-BINARY----------------+----------------><
   '-USAGE--+----+-'  +-COMPUTATIONAL---------+   
            '-IS-'    +-COMP------------------+   
                      |                 (1)   |   
                      +-COMPUTATIONAL-1-------+   
                      |        (1)            |   
                      +-COMP-1----------------+   
                      |                 (1)   |   
                      +-COMPUTATIONAL-2-------+   
                      |        (1)            |   
                      +-COMP-2----------------+   
                      |                 (1)   |   
                      +-COMPUTATIONAL-3-------+   
                      |        (1)            |   
                      +-COMP-3----------------+   
                      |                 (1)   |   
                      +-COMPUTATIONAL-4-------+   
                      |        (1)            |   
                      +-COMP-4----------------+   
                      |                 (1)   |   
                      +-COMPUTATIONAL-5-------+   
                      |        (1)            |   
                      +-COMP-5----------------+   
                      +-DISPLAY---------------+   
                      |           (1)         |   
                      +-DISPLAY-1-------------+   
                      +-INDEX-----------------+   
                      |          (1)          |   
                      +-NATIONAL--------------+   
                      +-PACKED-DECIMAL--------+   
                      |         (1)           |   
                      +-POINTER---------------+   
                      |                   (1) |   
                      '-PROCEDURE-POINTER-----'   

Notes:
  1. IBM® Extension
The following table outlines the phrase that is used for the various data items specified by the USAGE clause.
Table 1. Usage Clause Data Items
Data Item Phrase in USAGE Clause
Binary (computational item)

BINARY or
COMPUTATIONAL-41 or
COMP-41

Native binary (computational item)

COMPUTATIONAL-51 or
COMP-51

Packed-decimal/Internal decimal (computational item)

PACKED-DECIMAL or
COMPUTATIONAL or
COMP or
COMPUTATIONAL-31 or
COMP-31

Internal floating point (computational item)

COMPUTATIONAL-11 or
COMP-11 (4–byte)
COMPUTATIONAL-21 or
COMP-21 (8–byte)

Numeric DISPLAY items
     External decimal (zoned decimal)
     External floating-point1

DISPLAY

Non-numeric DISPLAY items
     Alphabetic
     Alphanumeric
     Alphanumeric-edited
     Numeric-edited items
     Boolean1
     Date time, and timestamp1

DISPLAY

DBCS1
DBCS-edited1

DISPLAY-1
Start of change

National1
National-edited1
National numeric1
National numeric-edited1

End of change
Start of changeNATIONALEnd of change
Index INDEX
Pointer1 POINTER
Procedure-pointer1 PROCEDURE-POINTER
Note:
  1. IBM Extension

The USAGE clause can be specified for an entry at any level (other than 66 or 88). However, if it is specified at the group level, it applies to each elementary item in the group rather than to the group itself. The usage of an elementary item must not contradict the usage specified on the owning group item.

When the USAGE clause is not specified at either the group or elementary level, it is assumed that the usage is DISPLAY.

IBM Extension
IBM Extension

The TYPE clause cannot be specified in the same data description entry as the USAGE clause.

Data description entries with a TYPE clause cannot be subordinate to a data description entry that contains a USAGE clause. For example, the following is illegal:
01 FLAGS   USAGE   DISPLAY.
   05 F-STATUS    TYPE CHAR.
   05 FLAG-ACTIVE TYPE CHAR.
End of IBM Extension
End of IBM Extension
Related Information: