Programming considerations

To embed SQL within a REXX exec, the host command environment must be changed. The ADDRESS instruction, followed by the name of the environment, is used to change the host command environment.

The ADDRESS instruction has two forms; one affects all commands issued after the instruction, and one affects only a single command. For more information about host command environments, see Changing the host command environment and for more information about the ADDRESS instruction, see ADDRESS.

The REXX/CICS command environments that support the REXX/CICS Db2® interface are:
EXECDB2
the command environment that supports Db2 commands.
EXECSQL
the command environment that supports SQL statements.
Note: EXECSQL and EXECDB2 are authorized commands. You must be a REXX/CICS authorized user to use the EXECSQL and EXECDB2 command environments.

REXX/CICS provides an exec called CICRXTRY that can be used to process REXX statements and commands interactively. CICRXTRY can be pseudo-conversational. The PSEUDO and SETSYS PSEUDO commands are used to turn pseudo-conversational mode on or off. If the environment is set to pseudo-conversational, SQL statements issued from CICRXTRY will be committed. If the environment is set to conversational, any SQL statements issued from the CICRXTRY exec will not be committed and any resources that are locked will remain locked until you exit the CICRXTRY exec or issue a CICS SYNCPOINT command. Similar considerations should be made if embedding SQL statements in lengthy REXX execs.