How IMS generic commands are processed
When you use the IMFEXEC statement to issue generic IMS commands, by default command processing is performed within the MainView AutoOPERATOR address space. This topic describes how MainView AutoOPERATOR processes wildcards when they are used with generic IMS commands.
When MainView AutoOPERATOR processes the commands, you can use wildcard characters in generic IMS resource names. The plus sign (+) or the percent sign (%) represents a single character and the asterisk (*) represents more than one character.
If you need to specify more than one generic IMS resource name with an IMS command, you must specify the K( ) keyword at the end of the command. The K( ) keyword must contain the keyword or keywords to be issued with the IMS command, one or more blank spaces, or a null if no keywords exist. Do not specify the K( ) keyword with IMS commands that do not include at least one generic name.
Following are some examples for using the K( ) keyword:
/STA DB CUST* K(ACCESS=UP DBALLOC)
/STA DB BBFMDB4+ CUSTHI+M K()
You can have IMS process the commands instead of MainView AutoOPERATOR by specifying the at sign (@) after the forward slash (/) and before the IMS command
When you specify the IMS command using this format, the IMS command is passed to IMS where generic parameter substitution takes place. To switch back to MainView AutoOPERATOR generic command processing, remove the @ sign from the IMFEXEC CMD statement.
If you attempt to specify an IMS generic command or keyword that is not supported by IMS, the following message is issued:
Command | Parameters |
---|---|
CMD | /IMS command |
The response segment is returned in the standard CLIST variable SYSDVAL, which can be parsed by using the READDVAL command. READDVAL functions the same way as in a TSO CLIST.
Parameters | Function | Notes |
---|---|---|
/IMS command | IMS command to be issued | For information about specifying IMS generic commands or using wildcard characters, refer to . For an example of issuing generic commands with IMS generic parameter support, refer to Example 3 - Issuing IMS generic commands with IMS generic Parameter support. |
Condition codes are listed in the following table:
Value | Description |
---|---|
0 | Command was issued and first segment of response returned in SYSDVAL. |
4 | Generic command format resulted in multiple IMS commands. SYSDVAL contains response to first command. |
8 | Command timed out; no response returned (Msg IM9215W issued). |
12 | One of the following situations occurred:
|
Example 1—Issuing generic commands
In this example, MainView AutoOPERATOR issues generic /STA DATABASE commands to start all databases whose names begin with BE3 or contain the characters ORDER in positions 4-8.
The * cannot be followed by any other characters and only one can be used in a string. You can use a + and an * together in a generic IMS resource command but the * must be the last character.
'IMFEXEC CMD /STA DATABASE BE3ORDER'
'IMFEXEC CMD /STA DATABASE BE3*'
'IMFEXEC CMD /STA DATABASE +++ORDER'
'IMFEXEC CMD /STA DATABASE BE+ORDER'
'IMFEXEC CMD /STA DB BBFMDB4+ CUSTHIDM K(ACCESS=UP)'
'IMFEXEC CMD /STA DB BBFMDB4+ CUSTHI+M K() '
CLIST example:
IMFEXEC CMD /STA DATABASE BE3*
IMFEXEC CMD /STA DATABASE +++ORDER
IMFEXEC CMD /STA DATABASE BE+ORDER
IMFEXEC CMD /STA DB BBFMDB4+ CUSTHIDM K(ACCESS=UP)
IMFEXEC CMD /STA DB BBFMDB4+ CUSTHI+M K()
Example 2 – Retrieving &SYSDVAL
This example starts an IMS transaction and verifies that the start command worked. This method of issuing an IMS command (no quotation marks) returns only the first response segment to the EXEC. Additional response segments are not available to the EXEC.
See the description of IMS command with response in the next section for information about accessing all response segments in an EXEC.
'IMFEXEC CMD /STA TRAN TE4COCNG'
/* SYSDVAL = DFS058 COMMAND COMPLETED EXCEPT FOR TE4COCNG */
READDVAL MSGID P1 P2 P3 P4 P5
IF P3 = 'EXCEPT' THEN DO
commands
END
CLIST example:
/* SYSDVAL = DFS058 COMMAND COMPLETED EXCEPT FOR TE4COCNG */
READDVAL MSGID P1 P2 P3 P4 P5
IF &P3 EQ EXCEPT THEN DO
commands
END
Example 3 – Issuing IMS generic commands with IMS generic Parameter support
In this example, MainView AutoOPERATOR issues the generic command /DIS TRAN and uses IMS generic parameter processing to display all APPC dynamic transactions starting with IDCF.
Note that the at (@) sign is specified after the slash (/) sign, which means IMS will perform the command processing.
'IMFEXEC CMD /@DIS TRAN IDCF*'
'IMFEXEC CMD /@DIS TRAN IDCF%%%%'