Character string format
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.
Required: O'NEILL Specify: C'O''NEILL'
Examples of valid and invalid character string constants are shown in Table 1:
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.
- < to represent SO
- > to represent SI
- Dn to represent a double-byte character
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 |