Embedding Db2 commands
You can use the EXECDB2 command environment to process the Db2® commands. Each Db2 command is passed to the Db2 instrumentation facility interface (IFI).
Most Db2 commands that are issued using DSN under TSO can be issued from CICS using the REXX/CICS Db2 Interface. The Db2 messages are returned in the predefined REXX compound variable DB2_OUTPUT.n.
You can make each request by writing a valid Db2 command as a REXX command
directed to the EXECDB2 environment. Use the following
syntax:
ADDRESS EXECDB2 "DB2 command"
or ADDRESS EXECDB2
"DB2 command"
"DB2 command"
.
.
.
Db2 commands can exist on
more than one line. Each part of the command is enclosed in single quotes and a comma delimits
additional command text as
follows:
ADDRESS EXECDB2
"DB2 command",
"additional text",
.
.
.
"final text"
The following rules apply to embedded Db2 commands:
- The REXX exec can issue many Db2 commands, but be careful which
commands you use. For example, do not use
"-STOP DB2"
. - The following Db2 commands
are passed directly to the EXECDB2 command environment:
- -ALTER BUFFERPOOL
- -ARCHIVE LOG
- -CANCEL DDF THREAD
- -DISPLAY ARCHIVE
- -DISPLAY BUFFERPOOL
- -DISPLAY DATABASE
- -DISPLAY LOCATION
- -DISPLAY RLIMIT
- -DISPLAY THREAD
- -DISPLAY TRACE
- -DISPLAY UTILITY
- -MODIFY TRACE
- -RECOVER BSDS
- -RECOVER INDOUBT
- -RESET INDOUBT
- -SET ARCHIVE
- -START DATABASE
- -START DDF
- -START RLIMIT
- -START TRACE
- -STOP DATABASE
- -STOP DB2
- -STOP DDF
- -STOP RLIMIT
- -STOP TRACE
- -TERM UTILITY
- You cannot use the following Db2 command:
- -START DB2. You can issue this command only from an MVS console.
- You can use REXX variables when passing input data to the EXECDB2 environment. The REXX variables are not embedded in quotes. The output from the EXECDB2 environment is provided in REXX predefined variables (see Receiving the results).
- The Db2 command string must be between six and 4092 characters long.
- The total length of all messages returned from the Db2 IFI is limited to 24K. If there are more messages than will fit in 24K bytes of memory, you can issue the Db2 command again, but with more specific parameter values, thus reducing the number of output messages.