Graphic Format

The graphic format is a character string where each character is represented by 2 bytes where all characters are part of a specific double-byte characer set.

Note: For information on the UCS-2 (Unicode) format which also uses double-byte characters, see UCS-2 Format.

Fields defined as graphic data do not contain shift-out (SO) or shift-in (SI) characters. The difference between single byte character and double byte graphic data is shown in the following figure:

Figure 1. Comparing Single-byte and graphic data
Comparing Single-byte and graphic data

The length of a graphic field, in bytes, is two times the number of graphic characters in the field.

The fixed-length graphic format is a character string with a set length where each character is represented by 2 bytes.

For information on the variable-length graphic format, see Variable-Length Character, Graphic and UCS-2 Formats.

You define a graphic field by specifying the GRAPH or VARGRAPH keyword in a free-form definition or by specifying G in the Data-Type entry of a fixed-form specification. You can also define one using the LIKE keyword on the definition specification where the parameter is a graphic field.

You can specify the default CCSID for graphic fields using the CCSID(*GRAPH) keyword on a Control statement or a /SET directive. You can also specify the CCSID explicitly using the Definition statement CCSID keyword.

Note: You cannot specify the CCSID keyword explicitly for a graphic definition if CCSID(*GRAPH:*IGNORE) is in effect. CCSID(*GRAPH:*IGNORE) is not in effect if either of the following is true:
  • Keyword CCSID(*EXACT) is specified on a Control statement.
  • Keyword CCSID(*GRAPH) is specified on a Control statement with a value other than *IGNORE.

The default initialization value for graphic data is X'4040'. The value of *HIVAL is X'FFFF', and the value of *LOVAL is X'0000'.

Note: The examples of graphic literals in this manual are not valid graphic literals. They use the letter 'o' to represent the shift-out character and the letter 'i' to represent the shift-in character. Often the graphic data is expressed as D1D2 or AABB; these are not valid double-byte characters. Normally, graphic literals are entered using a DBCS-capable keyboard that automatically enters the shift-out and shift-in characters before and after the DBCS characters are entered.