IBM Extension
IBM Extension

DBCS Literals

DBCS literals have the following format:

Read syntax diagramSkip visual syntax diagram
Format

>>-G"--DBCS-literal--"-----------------------------------------><

Read syntax diagramSkip visual syntax diagram
Format

>>-N"--DBCS-literal--"-----------------------------------------><

G" or N"
The opening delimiter for a DBCS literal.
"
The closing delimiter for a DBCS literal.

When the NATIONALPICNLIT PROCESS option is in effect, the opening delimiter N" or N' identifies a national literal, and the rules specified in Basic National Literals apply.

In general, the rules for forming a nonnumeric literal also apply to DBCS literals. The maximum length of DBCS literals, however, is 28 double-byte characters, and they cannot be continued across lines.

DBCS literals can be specified in the Data Division:
  • In the VALUE clause of DBCS data description entries. If you specify a DBCS literal in a VALUE clause for a data item, the length of the literal must not exceed the size indicated by the data item's PICTURE clause. Explicitly defining a DBCS data item as USAGE DISPLAY-1 specifies that the data item is to be stored in character form, one character to each 2 bytes.
  • With the JUSTIFIED clause.
DBCS literals can be specified in the Procedure Division:
  • As the sending item when a DBCS or group item is the receiving item.
  • In a relation condition when the comparand is a DBCS or group item.
  • As the figurative constants SPACE/SPACES, ALL SPACE/SPACES, or ALL followed by a DBCS literal. These are the only figurative constants that can be DBCS literals.
  • As an argument to an intrinsic function that supports DBCS.
DBCS literals can be specified wherever nonnumeric literals are allowed, except as a literal in the following:
  • Identification Division
    • PROGRAM-ID paragraph
  • Environment Division
    • ALPHABET clause
    • ASSIGN clause
    • CLASS clause
    • CURRENCY SIGN clause
    • LINKAGE clause
    • PADDING CHARACTER clause
    • RERUN clause
  • Procedure Division
    • CALL statement (program-name)
    • CANCEL statement
    • END PROGRAM header
    • STOP statement
    • DROP statement
    • ACQUIRE statement
  • COPY
    • COPY statement (text-name)
    • COPY statement (library-name).
End of IBM Extension
End of IBM Extension