CMD call
The Command (CMD) call enables an application
program to issue IMS commands.
Format
| Call Name | DB/DC | DBCTL | DCCTL | DB Batch | TM Batch |
|---|---|---|---|---|---|
| CMD | X | X |
Parameters
- i/o pcb
- Specifies the I/O PCB, the first PCB address in the list that is passed to the program. This parameter is an input and output parameter.
- aib
- Specifies the application interface block (AIB) that is used for
the call. This parameter is an input and output parameter. The following fields must be initialized in the AIB:
- AIBID
- Eye catcher. This 8-byte field must contain DFSAIBbb.
- AIBLEN
- AIB lengths. This field must contain the actual length of the AIB that the application program obtained.
- AIBRSNM1
- Resource name. This 8-byte, left-justified field must contain the PCB name IOPCBbbb.
- AIBOALEN
- I/O area length. This field must contain the length of the I/O area that is specified in the call list.
- i/o area
- Specifies the I/O area to use for this call. This parameter is an input and output parameter. The I/O area must be large enough to hold the largest segment passed between the program and IMS TM.
Usage
Use the CMD call
with the GCMD call to send commands to and receive
responses from IMS TM. After
the CMD call issues the command to IMS TM, IMS TM
processes the command and returns the first segment of the response
message to the application program's I/O area, but only if a CC status
code is returned on the CMD call. Your application
program must then issue GCMD calls to retrieve all
subsequent message segments one segment at a time. The CMD and GCMD command
calls are typically used to perform functions that are usually handled
by someone at a terminal. These programs are called automated operator
(AO) applications.
Before you issue a CMD call,
the IMS command that you want
to execute must be in the I/O area that you refer to in the call.
When you issue a CMD call, IMS TM passes the command from the I/O area to
the IMS control region for processing. IMS TM places your application program
in a wait state until the command is processed. The application program
remains in a wait state until IMS TM
returns a response. (Response means that IMS TM has received and processed the command.)
For asynchronous commands, you receive a response when the command
is processing, but not when it is complete.
You
can also issue DB2® commands
from your IMS TM application
program. Issue the command call and use the /SSR command,
followed by the DB2 command. IMS TM routes the command to DB2. DB2 issues
a response to the command, and IMS TM
routes the DB2 response to the
master terminal operator (MTO).
Restrictions
The AIB must specify the I/O PCB for this call.
Any application program that uses this call must be authorized by the security administrator.
You
cannot issue a CMD call from a CPI-C driven application
program.
This call is not supported in an IFP or non-message-driven BMP.
