USAGE clause

The USAGE clause specifies the format in which data is represented in storage.

Format 1

Read syntax diagramSkip visual syntax diagramUSAGEISBINARYNATIVECOMPNATIVECOMP-1NATIVECOMP-2NATIVECOMP-3NATIVE1COMP-4NATIVECOMP-5NATIVE1COMPUTATIONALNATIVECOMPUTATIONAL-1NATIVECOMPUTATIONAL-2NATIVECOMPUTATIONAL-3NATIVE1COMPUTATIONAL-4NATIVECOMPUTATIONAL-5NATIVE1DISPLAYNATIVEDISPLAY-1NATIVEINDEXNATIONALNATIVEobjref phrasePACKED-DECIMALNATIVE1POINTERPROCEDURE-POINTERFUNCTION-POINTER
objref phrase
Read syntax diagramSkip visual syntax diagramOBJECT REFERENCE class-name-1
Notes:
  • 1 The NATIVE phrase is treated as a comment for COMP-3, COMPUTATIONAL-3, COMP-5, COMPUTATIONAL-5, NATIONAL, and PACKED-DECIMAL data items.

The USAGE clause can be specified for a data description entry with any level-number other than 66 or 88.

When specified at the group level, the USAGE clause applies to each elementary item in the group. The usage of elementary items must not contradict the usage of a group to which the elementary items belongs.

A USAGE clause must not be specified in a group level entry for which a GROUP-USAGE NATIONAL clause is specified.

When a GROUP-USAGE NATIONAL clause is specified or implied for a group level entry, USAGE NATIONAL must be specified or implied for every elementary item within the group. For details, see GROUP-USAGE clause.

When the USAGE clause is not specified at either the group or elementary level, a usage clause is implied with:

  • Usage DISPLAY when the PICTURE clause contains only symbols other than G or N
  • Usage NATIONAL when the PICTURE clause contains only one or more of the symbol N and the NSYMBOL(NATIONAL) compiler option is in effect
  • Usage DISPLAY-1 when the PICTURE clause contains one or more of the symbol N and the NSYMBOL(DBCS) compiler option is in effect

For data items defined with the DATE FORMAT clause, only usage DISPLAY and COMP-3 (or its equivalents, COMPUTATIONAL-3 and PACKED-DECIMAL) are allowed. For details, see Combining the DATE FORMAT clause with other clauses.