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.
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-----'
| Data Item | Phrase in USAGE Clause |
|---|---|
| Binary (computational item) | BINARY or |
| Native binary (computational item) | COMPUTATIONAL-51 or |
| Packed-decimal/Internal decimal (computational item) | PACKED-DECIMAL or |
| Internal floating point (computational item) | COMPUTATIONAL-11 or |
Numeric DISPLAY items |
DISPLAY |
Non-numeric DISPLAY items |
DISPLAY |
DBCS1 |
DISPLAY-1 |
| National1 | NATIONAL |
| Index | INDEX |
| Pointer1 | POINTER |
| Procedure-pointer1 | PROCEDURE-POINTER |
Note:
|
|
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.
The TYPE clause cannot be specified in the same data description entry as the USAGE clause.
01 FLAGS USAGE DISPLAY.
05 F-STATUS TYPE CHAR.
05 FLAG-ACTIVE TYPE CHAR.