IBM SC34-5764-01 Server User Manual


 
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:
v The DBCS portion of the symbol must be an even number of bytes in length
v DBCS 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
v DBCS characters cannot be used as special characters in REXX
v SO and SI cannot be contiguous
v Nesting of SO or SI is not permitted
v SO and SI must be paired
v No part of a symbol consisting of DBCS characters may contain a DBCS blank.
v Each 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:
v DBCS strings must be an even number of bytes in length, unless you have SO and SI.
EBCDIC only:
v SO and SI must be paired in a string.
v Nesting 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