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.
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 argument to the exec. For example: EDIT TEST.EXEC causes the REXX/CICS editor exec, CICEDIT, to start and TEST.EXEC, the argument, names the file to edit or create. All REXX/CICS transaction identifiers must have CICS definitions which associate them with the REXX/CICS main module, CICREXD.
REXX/CICS execs may be started using the CICS START command. The START command names the CICS transaction identified to start and the table created by the REXX/CICS DEFTRNID command names the exec to start. If the exec is CICRXTRY and CICS start data is present, the first operand names the exec to start and any other operands are passed to the exec as an argument. If no start data is present, then CICRXTRY is started. For execs other than CICRXTRY, start data is passed to the exec as an argument. Usually, REXX/CICS execs have a terminal associated with them. However, if a REXX/CICS exec does not have a terminal associated to the transaction, any terminal output is either discarded or directed to a CICS temporary storage queue as specified by the REXX/CICS SET TERMOUT command. An error is generated if terminal input is requested for a transaction for which no terminal is associated.
The REXX/CICS interface program CICREXD may be invoked using the CICS LINK or XCTL command. A COMMAREA must be passed to the interface program when invoked in this way. The COMMAREA must contain operands that name the exec to start and an argument to be passed. The exec name is expected as the first blank delimited token in the COMMAREA.
REXX/CICS execs are executed as part of the CICS task that issues them, within the CICS region. The REXX interpreter is fully reentrant and runs above the 16 megabyte line (AMODE=31, RMODE=ANY).
The following rules are used to locate and load an exec into storage so it can be started:
REXX execs can be edited using the supplied REXX/CICS editor. Also, if REXX/CICS execs reside in a VSE Librarian member, they can be edited using other editors such as the librarian member edit component of DITTO.
Execs can be stored as members in the VSAM-based REXX File System (RFS), provided with REXX/CICS, or in VSE librarian members with a member type of PROC.
The CD and PATH commands define the search order of user REXX libraries when you attempt to load an exec. After the current directory (set by the CD command) is searched, all directories specified with the PATH command are searched, then VSE sublibraries specified on the SETSYS AUTHCLIB and SETSYS AUTHELIB commands are searched, followed by VSE Librarian members with a member type of PROC in the LIBDEF PROC search chain for the CICS partition.
An exec may be defined so it can be invoked as a REXX/CICS command. The DEFCMD command is used to define REXX/CICS user commands. DEFCMD supports commands written in REXX as well as the standard CICS supported languages. For more information on the DEFCMD command, see section DEFCMD.