You can
use double-byte character set (DBCS) names in your REXX execs for
literal strings, labels, variable names, and comments. Such character
strings can be single-byte, double-byte, or a combination of both
single- and double-byte names. To use DBCS names, you must code OPTIONS
ETMODE as the first instruction in the exec. ETMODE specifies that
those strings that contain DBCS characters are to be checked as being
valid DBCS strings. DBCS characters must be enclosed within shift-out
(X'0E') and shift-in (X'0F') delimiters. In the
following example, the shift-out (SO) and shift-in (SI) delimiters
are represented by the less than symbol ( < ) and the greater than
symbol ( > ) respectively. 1 For
example, <.S.Y.M.D> and <.D.B.C.S.R.T.N> represent DBCS symbols
in the following examples.
Example 1
The following is an example of an exec using a DBCS variable name
and a DBCS subroutine label.
/* REXX */
OPTIONS 'ETMODE' /* ETMODE to enable DBCS variable names */
j = 1
<.S.Y.M.D> = 10 /* Variable with DBCS characters between
shift-out (<) and shift-in (>) */
CALL <.D.B.C.S.R.T.N> /* Invoke subroutine with DBCS name */
⋮
<.D.B.C.S.R.T.N>: /* Subroutine with DBCS name */
DO i = 1 TO 10
IF x.i = <.S.Y.D.M> THEN /* Does x.i match the DBCS variable's
value? */
SAY 'Value of the DBCS variable is : ' <.S.Y.D.M>
END
EXIT 0
Example 2
The following example shows some other uses of DBCS variable names
with the EXECIO stem option, as DBCS parameters passed to a program
invoked through LINKMVS, and with built-in function, LENGTH.
/* REXX */
OPTIONS 'ETMODE' /* ETMODE to enable DBCS variable names */
"ALLOC FI(INDD) DA('DEPTA29.DATA') SHR REU"
/*******************************************************************/
/* Use EXECIO to read lines into DBCS stem variables */
/*******************************************************************/
"EXECIO * DISKR indd (FINIS STEM <.d.b.c.s__.s.t.e.m>."
IF rc = 0 THEN /* if good return code from execio */
/*****************************************************************/
/* Say each DBCS stem variable set by EXECIO */
/*****************************************************************/
DO i = 1 TO <.d.b.c.s__.s.t.e.m>.0
SAY "Line " i "==> " <.d.b.c.s__.s.t.e.m>.i
END
line1_<.v.a.l.u.e> = <.d.b.c.s__.s.t.e.m>.1 /* line 1 value */
line_len = length(line1_<.v.a.l.u.e>) /* Length of line */
/*******************************************************************/
/* Invoke LINKMVS command "proca29" to process a line. */
/* Two variable names are used to pass 2 parameters, one of */
/* which is a DBCS variable name. The LINKMVS host command */
/* environment routine will look up the value of the two */
/* variables and pass their values to the address LINKMVS */
/* command, "proca29". */
/*******************************************************************/
ADDRESS LINKMVS "proca29 line_len line1_<.v.a.l.u.e>"
"FREE FI(INDD)"
EXIT 0