AOEXEC CMD (Issue MVS command with response)
This command issues MVS commands.
Command | Parameters |
---|---|
CMD | TEXT('MVSCommand') [RESPONSE(*|MessageID)] [COUNT|LINES(1|n)] [DELAY|DLY(nnnnn)] [WAIT(10|n)] [ALL|ALLWAIT(1 - 15)] [NAME(xxxxxxxx)] [DEBUG] [TYPE(MVS)] [STEM ( )] [ENDMSG( )] SS | SSID(subsystemIdentifier) [AOOPTION | AOOPT(ANV, CAO, IAO, IIZ, MAO, QAO, or TSH)] AOOPTION [TGTJNT()] [TGTSS(targetSubsystemIdentifier)] |
To issue an MVS command without response, use the following format where COUNT(0) is specified:
Command | Parameters | Notes |
---|---|---|
TEXT(‘MVSCommand’) | Specifies the MVS command to be issued | The maximum length of an MVS command is 126 characters. |
RESPONSE | Specifies the message ID(s) expected for response | The default is an asterisk (*), which means any message. You can specify up to 8 message IDs, separated by commas, each up to 16 characters long. Wild cards are allowed. If you specify RESPONSE(*), the EXEC picks up all messages from the selected MVS console. If there are messages that are responses to previous commands on the same MVS console, it is recommended that you specify RESPONSE for the MSG ID. |
COUNT|LINES | Specifies the number of response lines to be retrieved | Default is 1. Valid values are 0 through 9999. A multi-line WTO (MLWTO) is counted as one line (even though it may be composed of many lines, as in some VTAM command responses). When you specify COUNT(0) with the AOEXEC CMD TEXT('MVSCommand’) in an EXEC, it means that this EXEC is not expecting a response from the MVS command that is issued. |
DELAY|DLY | Specifies that the command executes in nnnnn seconds of time | Valid values are 0 to 99999 seconds. The default value is 0 seconds, which means the command is executed with no delay. In addition, the DELAY|DLY parameter includes the following conditions:
|
WAIT | Specifies the length of time to wait for all response lines to arrive | Default is 10 seconds. Valid values are 5 through 99 seconds. |
ALL | Retrieves all responses | Using this parameter causes EXEC processing to ignore all of the other parameters and wait for additional responses (as long as responses continue to arrive within half-second intervals). |
ALLWAIT | Specifies the wait interval | Specify an interval to wait from 1 to 15 seconds. ALLWAIT allows CMD processing to continue waiting in intervals (specified in seconds) until no responses are received within an interval of that length. If at least one response is received in that interval, processing continues for an additional interval. This processing is repeated until no responses are received within an interval, which may result in added wait time. Therefore small intervals of 1-5 are recommended; for example: AOEXEC CMD TEXT('cmd_text') ALL ALLWAIT(3) Processing waits 3 seconds as specified in ALLWAIT and then checks to see if any responses were received. If none, the command is terminated. If a response was received, processing waits an additional 3 seconds and checks again. This action is repeated until no responses are received within the specified interval. ALLWAIT is valid only when ALL is specified. |
NAME | Specify a valid MVS console name | Use this parameter if the command must be issued from a specific MVS console name. When the COUNT(parameter ) has a setting greater than zero (0) such as the default of 1, the NAME parameter must specify a currently inactive or undefined MVS console name; this console name must not be in use by any other jobs. BMC AMI OpsA requires exclusive control of the MVS console to read the command responses. If you specify COUNT(0), which means that responses are not required, the NAME( ) parameter can specify any MVS console name (active, inactive, or undefined), and even specify consoles that are currently owned by BMC AMI OpsA or another program. When you specify COUNT(0), the NAME keyword can specify a BMC AMI OpsA response console name such as ssid0001, ssid0002, and so on. To use the same console name as an earlier AOEXEC CMD command that was issued in the same EXEC, specify the variable name IMFCNAME. When command responses are expected, one of the following things can happen (depending on the state of the console of the console name you specified):
The NAME and CONSOLE parameters cannot be used together. |
DEBUG | Issues debugging messages | This command is used for problem diagnosis. |
STEM | Returns command responses in REXX stem TSO variables where the value of stem.0 resolves to the number of lines returned | Specify a stem root name for the REXX stem variable. In addition: The default is LINE.
If the stem name provided ends in a period (.), BMC AMI OpsA processing ignores the period. For example, specifying STEM(MYVAR.) produces the same result as specifying STEM(MYVAR). |
ENDMSG | Specifies one to eight words where each word can be one to sixteen characters, separated by blanks or commas | Use the ENDMSG parameter when you know a specific message ID is available and indicates the end of the WTO Only single line WTOs and the major line of multi-line WTOs are inspected for the ENDMSG() parameter. The minor lines of MLWTOs are not inspected. If none of the WTOs have a message ID that match the ENDMSG parameter, the AOEXEC CMD ends based on other parameters such as LINES() or WAIT(). The command performs as if the ENDMSG parameter had not been specified. If the RESPONSE() parameter is specified, you can specify ENDMSG() and specify words that are not in specified with the RESPONSE parameter. This means the ending message ID does not have to be one of the WTOs that are returned in the LINE.n variables. For example, you can specify the AOEXEC CMD to retrieve all response WTOs up to and including the special message ID that marks the end of the WTOs. If you do not specify the ENDMSG parameter you could code LINES(equal or larger than the maximum WTOs expected) however the AOEXEC CMD might have to wait the entire timeout period (for example, 30 seconds). By using the ENDMSG parameter, the AOEXEC CMD ends immediately when a WTO that matches ENDMSG() is received and the EXEC does not have to wait. |
SS | SSID | Specifies the subsystem identifier of a local subsystem | Generic wildcard characters are supported for this keyword. You can specify 1 to 4 asterisks (*) or plus signs (+).
Use the AOOPTION parameter to further filter on the wildcard value. By specifying a value with AOOPTION, you can route the EXEC to the BMC AMI OpsA BBI-SS PAS that is running a product option or group of product options. AOOPTION is mutually exclusive with TGTSS and TGTJNT, and it is ignored on a fully qualified SSID specified with SS or SSID parameter. |
AOOPTION | Specifies the product options that must be active in the BMC AMI OpsA PAS. The following values are valid: ANV, CAO, IAO, IIZ, MAO, QAO, or TSH. IIZ represents the BMC AMI OpsA BMC Impact Integration for z/OS product. The stand-alone BMC Impact Integration for z/OS product does not support AOAnywhere. | The specified product option must be active in the BMC AMI OpsA PAS. The value specified with the AOOPTION parameter is valid only when the SSID parameter specifies a wildcard value. AOOPTION cannot be specified if TGTSS or TGTJNT are also specified. |
TGTJNT() | Specifies a JNT entry that identifies the SSID which processes this request | Use this parameter to specify a different target from the target system where the EXEC is invoked. The specified TGTJNT() should match a TARGET=(tgtname) parameter that is entered in BBPARM member BBIJNT00. The EXEC is scheduled on the subsystem that corresponds to the subsystem that is specified by the SS | SSID parameter of the JNT entry. The specified TGTJNT() may also be an SSID with which the original subsystem communicates. This keyword is mutually exclusive with the TGTSS() keyword. Note: The target subsystem named in the TGTJNT entry must exist within the current sysplex. |
TGTSS | If specified, the subsystem specified by the SS | SSID() keyword is considered a router and the actual function is executed on the subsystem specified by TGTSS(). If not specified, the requested function is executed on the subsystem specified by the SS | SSID keyword. | It must be in the same sysplex as the BBI-SS specified with the SSID() keyword, and both systems must have the same XCFGROUP specified in the BBPARM BBISSPxx. When the AOEXEC command originates in a NetView EXEC, the router and local BMC AMI OpsA PAS must have an active, valid BMC AMI Ops Automation Access NV key. |
Condition codes are listed in the following table.
Value | Description |
---|---|
0 | Command responded within WAIT time. |
4 | Command partially responded within WAIT time. |
8 | No reply has been received; WAIT time has expired. |
20 | Severe error occurred; see short message text for more information. |
Example 1
This EXEC issues an MVS command on the local system and on a remote MVS system.
PARSE ARG EXNAME .
ss1 = 'Lpas'
tgt1 = 'Tpas'
cmd1 = 'D NET,MAJNODES'
rsp1 = 'IST350I'
"AOEXEC CMD TEXT(''cmd1'') RESP('rsp1') STEM(lin2) SS('ss1')" ,
"TGTSS('tgt1')"
if lin2.0 > 0 then
do i = 1 to lin2.0
say 'lin2.'i value('lin2.'i)
end i
Example 2
cmd1 = 'D IPLINFO'
'AOEXEC CMD TEXT(''cmd1'') STEM(lin2) SS('ss1')'
say 'aoexec cmd' cmd1 'rc='rc
if lin2.0 > 0 then
do i = 1 to lin2.0
say 'lin2.'i value('lin2.'i)
end i
This section contains the following topic:
Related topic