character is X'0F') The SO and SI characters are non-printable. In the following example, the less than (<)
and greater than (>) symbols represent shift-out (SO) and shift-in (SI), respectively. For example,
<.S.Y.M.D> and <.D.B.C.S.R.T.N> represent DBCS symbols in the following example.
Example
The following is an example of a program using a DBCS variable name and a DBCS subroutine label.
/* REXX */
OPTIONS 'ETMODE' /* ETMODE to enable DBCS variable names */
<.S.Y.M.D> = 10 /* Variable with DBCS characters between */
/* shift-out (<) and shift-in (>) */
y.<.S.Y.M.D> = JUNK
CALL <.D.B.C.S.R.T.N> /* Call subroutine with DBCS name */
EXIT
<.D.B.C.S.R.T.N>: /* Subroutine with DBCS name */
DOi=1TO10
IF y.i = JUNK THEN /* Does y.i match the DBCS variable's
value? */
SAY 'Value of the DBCS variable is : ' <.S.Y.M.D>
END
RETURN
Typing in a Program
When you type in the following program, use the REXX/CICS editor for files that reside in the REXX File
System (RFS).
The name of the program is HELLO EXEC (for now, assume that the file type is exec).
1. Sign on to a CICS Transaction Server for VSE/ESA terminal by entering CESN and supplying your user
ID and password when it is requested.
2. Clear the screen.
3. Type:
edit hello.exec
4. Type in the program, exactly as it is shown in Figure 4, beginning with /* REXX HELLO EXEC */. Then
file it using the EDIT command:
====> file
Now your program is ready to run.
Running a Program
Clear the screen before running an exec. If you want to run a program that has a file type of EXEC, you
type in REXX followed by its file name. In this case, type rexx hello on the command line and press Enter.
Try it!
Suppose your name is Sam. Type sam and press Enter. Hello SAM is displayed.
/* REXX HELLO EXEC */
/* A conversation */
say "Hello! What is your name?"
pull who
if who = "" then say "Hello stranger!"
else say "Hello" who
Figure 4. HELLO EXEC
Writing and Running a REXX Program
Chapter 2. Writing and Running a REXX Program 11