Validation
The user must follow certain rules and conditions when using DBCS.

DBCS Symbol Validation

DBCS symbols are valid only if you comply with the following rules:
vThe DBCS portion of the symbol must be an even number of bytes in length
vDBCS alphanumeric and special symbols are regarded as different to their corresponding SBCS
characters. Only the SBCS characters are recognized by REXX in numbers, instruction keywords, or
operators
vDBCS characters cannot be used as special characters in REXX
vSO and SI cannot be contiguous
vNesting of SO or SI is not permitted
vSO and SI must be paired
vNo part of a symbol consisting of DBCS characters may contain a DBCS blank.
vEach part of a symbol consisting of DBCS characters must be bracketed with SO and SI.
These examples show some possible misuses:
<.A.BC> -> Incorrect because of odd byte length
<.A.B><.C> -> Incorrect contiguous SO/SI
<> -> Incorrect contiguous SO/SI (null DBCS symbol)
<.A<.B>.C> -> Incorrectly nested SO/SI
<.A.B.C -> Incorrect because SO/SI not paired
<.A. .B> -> Incorrect because contains blank
'. A<.B><.C> -> Incorrect symbol

Mixed String Validation

The validation of mixed strings depends on the instruction, operator, or function. If you use a mixed string
with an instruction, operator, or function that does not allow mixed strings, this causes a syntax error.
The following rules must be followed for mixed string validation:
vDBCS strings must be an even number of bytes in length, unless you have SO and SI.
EBCDIC only:
vSO and SI must be paired in a string.
vNesting of SO or SI is not permitted.
These examples show some possible misuses:
'ab<cd' -> INCORRECT - not paired
'<.A<.B>.C> -> INCORRECT - nested
'<.A.BC>' -> INCORRECT - odd byte length
The end of a comment delimiter is not found within DBCS character sequences. For example, when the
program contains /*<*/, then the */ is not recognized as ending the comment because the scanning is
looking for the >(SI) to go with the <(SO) and not looking for */.
When a variable is created, modified, or referred to in a REXX program under OPTIONS EXMODE, it is
validated whether it contains a correct mixed string or not. When a referred variable contains a mixed
string that is not valid, it depends on the instruction, function, or operator whether it causes a syntax error.
The ARG, PARSE, PULL, PUSH, QUEUE, SAY, TRACE, and UPPER instructions all require valid mixed
strings with OPTIONS EXMODE in effect.
Instruction Examples
Here are some examples that illustrate how instructions work with DBCS.
Appendix C. Double-Byte Character Set (DBCS) Support 397