IBM SC34-5764-01 Server User Manual


 
The expression is evaluated, resulting in a character string (which may be the null string), which is then
prepared as appropriate and submitted to the underlying system. Any part of the expression not to be
evaluated should be enclosed in quotation marks.
The environment then processes the command, which may have side-effects. It eventually returns control
to the language processor, after setting a return code. A return code is a string, typically a number, that
returns some information about the command that has been processed. A return code usually indicates if a
command was successful or not, but can also represent other information. The language processor places
this return code in the REXX special variable RC. See section “Special Variables” on page 228.
In addition to setting a return code, the underlying system may also indicate to the language processor if
an error or failure occurred. An error is a condition raised by a command for which a program that uses
that command would usually be expected to be prepared. (For example, a locate command to an editing
system might report requested string not found as an error.) A failure is a condition raised by a
command for which a program that uses that command would not usually be expected to recover (for
example, a command that is not executable or cannot be found).
Errors and failures in commands can affect REXX processing if a condition trap for ERROR or FAILURE is
ON (see Chapter 17, “Conditions and Condition Traps,” on page 225). They may also cause the command
to be traced if TRACE E or TRACE F is set. TRACE Normal is the same as TRACE F and is the default—see
page “Purpose” on page 166.
Here is an example of submitting a command to the default REXX/CICS command environment. The
sequence:
TSQ1 = 'TSQUEUE1'
"EXECIO * READ" TSQ1 "MYDATA."
results in the string EXECIO * READ TSQUEUE1 MYDATA. being submitted to REXX/CICS.
On return, the return code placed in RC has the value 0 if the CICS temporary storage queue TSQUEUE1
was successfully read into MYDATA array. If TSQUEUE1 is empty the appropriate return code is placed in
RC.
Note: Remember that the expression is evaluated before it is passed to the environment. Enclose in
quotation marks any part of the expression that is not to be evaluated.
Example:
"EXECIO * READ" /* * does not mean "multiplied by" */
Basic Structure of REXX Running Under CICS
REXX/CICS support provides a main interface program named CICREXD which is used to load and issue
REXX execs within a CICS region. Each REXX exec runs under a separate CICS task. Any nested REXX
execs run under the CICS task of the parent exec.
REXX Exec Invocation
v Execs started from a terminal
CICS uses transaction identifiers associated with programs to determine which programs to execute.
REXX/CICS uses a table created by the REXX/CICS command, DEFTRNID, to associate CICS
transaction identifiers with specific REXX execs. The CICS transaction identifier associated with the
REXX/CICS supplied exec, CICRXTRY, is known as the default REXX/CICS transaction identifier. The
supplied default is REXX. If REXX is entered from a CICS screen alone, the CICRXTRY exec is started.
If other operands are specified, for example: REXX MYEXEC ABC, the exec MYEXEC is started and
ABC is passed to it as an argument. CICS transaction identifiers other than the REXX/CICS default
transaction identifier cause the associated exec to be started and any other operands are passed as an
REXX General Concepts
Chapter 12. REXX General Concepts 125