CCSID of literals and compile-time data

If CCSID(*EXACT) is specified on a Control statement

  • Character literals have the CCSID of the compilation.
  • Graphic literals have the DBCS CCSID related to the CCSID of the compilation.

The CCSID of the compilation is the CCSID used to read the source files. It is specified by the TGTCCSID parameter of the command. The TGTCCSID parameter defaults to TGTCCSID(*SRC), which is the EBCDIC CCSID related to the CCSID of the primary source file. For more information about the TGTCCSID parameter, see the description of the CRTBNDRPG command in Rational Development Studio for i: ILE RPG Programmer's Guide.

If CCSID(*EXACT) is not specified
  • Character literals have the mixed-byte CCSID related to the job CCSID at runtime. When a character literal contains X'0E', the compiler will always treat it as a shift-out character, independent of the CCSID(*CHAR) keyword.
  • Graphic literals have the CCSID specfified by the CCSID(*GRAPH) Control-statement keyword. If the CCSID(*GRAPH) keyword is not specified, graphic literals do not have a CCSID.

UCS-2 literals have the CCSID specified by the CCSID(*UCS2) Control-statement keyword. If this keyword is not specified, UCS-2 literals have CCSID 13488.

Hexadecimal literals have CCSID 65535 or *HEX.

The CCSID of compile-time data is the same as the CCSID of literals.