How to Specify Literals Containing DBCS Characters

When you specify any literal that contains DBCS characters, follow the same rules that apply in specifying alphanumeric literals, as well as the following rules specific to mixed and DBCS literals:
  • Mixed literals can take many different forms. The following are only two possible examples:
    "SINGLE0EK1K2K30FBYTES"
    "0EK1K20F"
  • DBCS literals start with
    G"OE or N"0E
    followed by one or more Double-Byte characters and ended with
    0F"
    An example of this is as follows:
    G"0EKIK20F"
    N"0E  0F"
  • Mixed literals have an implicit USAGE DISPLAY. DBCS literals have an implicit USAGE DISPLAY-1.
  • EBCDIC characters can appear before or after any DBCS string in the mixed literal.
  • All DBCS strings appear between shift-out and shift-in characters. A shift-out character is a control character (hex 0E) that indicates the start of a string of double-byte characters. A shift-out character occupies 1 byte. A shift-in character is a control character (hex 0F) that indicates the end of a string of double-byte characters. A shift-in character occupies 1 byte.
  • Double all SBCS quotation marks that occur within the mixed literal. DBCS quotation marks within G" literals do not require doubling but DBCS quotation marks within N" literals must be doubled. For example:
      "Mixed ""0EK1K2K30F"" literal"
      G"0EK1K2K3"K4"K5K60F"
      N"0EK1K2K3""K4""K5K60F"
  • You can use null DBCS strings (shift-out and shift-in characters without any DBCS characters) in a mixed literal only when the literal contains at least one SBCS character.

The shift-out and shift-in characters cannot be nested.

The shift control characters are part of a mixed literal (not a pure DBCS literal), and take part in all operations.