z/OS DFSORT Application Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Character string format

z/OS DFSORT Application Programming Guide
SC23-6878-00

The format for coding a character string constant is:

C'xx...x'

The value x may be any EBCDIC character (the EBCDIC character string is translated appropriately for comparison to an AC or AQ field). You can specify up to 256 characters.

If you want to include a single apostrophe in the character string, you must specify it as two single apostrophes. Thus:
Required:  O'NEILL  Specify: C'O''NEILL'

Examples of valid and invalid character string constants are shown in Table 1:

Table 1. Valid and Invalid Character String Constants
Valid Invalid Explanation
C'JDCO' C''''' Apostrophes not paired
C'$@#' 'ABCDEF' C identifier missing
C'+0.193' C'ABCDEF Apostrophe missing
C'Frank''s' C'Frank's' Two single apostrophes needed for one

Double-byte data may be used in a character string for INCLUDE/OMIT comparisons. The start of double-byte data is delimited by the shift-out (SO) control character (X'0E'), and the end by the shift-in (SI) control character (X'0F'). SO and SI control characters are part of the character string and must be paired with zero or an even number of intervening bytes. Nested shift codes are not allowed. All characters between SO and SI must be valid double-byte characters. No single-byte meaning is drawn from the double-byte data.

Examples of valid and invalid character string constants containing double-byte characters are shown in Table 2 using:
  • < to represent SO
  • > to represent SI
  • Dn to represent a double-byte character
Table 2. Valid and Invalid Strings with Double-Byte Data
Valid and Invalid Strings with Double-Byte DataValid
Invalid Explanation
C'Q<D1D2>T' C'Q<R>S' Single-byte data within SO/SI
C'<D1D2D3>' C'D1D2D3' Missing SO/SI; treated as single-byte data
C'Q<D1>R<D2>' C'Q<D1<D2>>' Nested SO/SI
Tip: X'0E', X'0F', and X'7D' are treated as the special characters shift-out, shift-in, and single apostrophe in a character string. If you don't want to treat one or more of these characters as special in a particular value, use a hexadecimal string instead of a character string. For example, if you want to treat the binary value 000E0E7D as its decimal equivalent of 921213, use X'000E0E7D'; 0E will not be treated as shift-out and 7D will not be treated as a single apostrophe.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014