Previous Topic: OPSBRW Command Processor—View Automation Events

Next Topic: OPSCMD Security and Auditability

OPSCMD Command Processor—Issue z/OS, JES, VM, and IMS Commands

The OPSCMD command processor issues z/OS, JES, VM, and IMS commands from a CLIST, an OPS/REXX program, a TSO/E REXX program, or a TSO terminal and receives the command output.

Note: You can use OPSCMD to issue IMS commands only if your site has licensed the CA OPS/MVS optional IMS Operations Facility.

Use either of the following formats to issue the OPSCMD command processor.

Note: Format 2 for the OPSCMD command processor supports most of the same keywords that the ADDRESS OPER host environment supports. If you are unsure of the meaning of any of these keywords, see the description of the ADDRESS OPER command keywords in the chapter "Host Environment Commands."

  1. Use this format for the OPSCMD command processor when you do not want to specify any additional keywords:
    OPSCMD commandtext
    
  2. Use the following format to specify additional keywords for the OPSCMD command processor:

    Note: The REPLY keyword on the CMDRESP keyword is optional.

    OPSCMD COMMAND(text) BMPCMDOUT(OPSLOG|WTO|NONE)
    
                     CAPTURE(msgtextlist)
                     CMDECHO(YES|NO)
                     CMDLOG(YES|NO)
                     CMDRESP(destination,[REPLY])
                     CMDWAIT(seconds)
                     CONTYPE(ANY|EXTCONS|SSCONS|XTRACONS)
                     DELAY(seconds)
                     IMSID(name|*|list)
                     IMSPLEX(name|*)
                     IMSREPLY
                     INTERVAL(ocinterval)
                     LOG(YES|NO|OFF)
                     MAXCMDOUT(number)
                     MFORM(M|J|S)
                     NAME|CONNAME(consolename)
                     NOCLIST
                     OUTDELIM(delimstring,YES|NO)
                     OUTPUT|NOOUTPUT
                     PREFIX(CMDOUT,prefix)
                     STOPEND(YES|NO)
                     STOPMSG(msgtextlist)
                     STOPRESP(msgtextlist)
                     SUBSYS(OPSS,ssid)
                     SYSID|SYSTEM(msfids|ALL|EXT)
                     SYSWAIT(seconds)
                     WAIT(seconds)
                     XML(YES|NO)
    
commandtext

The commandtext operand is the text of the command for OPSCMD. This text is totally freeform, and CA OPS/MVS does not convert it to uppercase characters.

COMMAND

The COMMAND keyword supplies the text of the system command you are issuing.

The COMMAND keyword has no default value. If you omit this keyword but specify other keywords, CA OPS/MVS places you in OPSCMD subcommand mode.

If the command text contains unmatched parentheses, you must follow conventional TSO syntax and enclose the text in quotation marks.

If you use non-alphabetic characters as command control characters, you might need to enclose the command in quotation marks.

You can invoke OPSCMD without keywords so long as the first word of the command string does not conflict with any keywords or their operands.

Example: Specify command text. In the example, quotes are used to delimit command text.

OPSCMD COMMAND(')testrex')
CMDRESP

This keyword determines where the output from any variation of OPSCMD goes. Specify any of the following as the destination of output:

TERMINAL

Displays the command output as lines on a TSO terminal. CMDRESP(TERMINAL) is the default.

CLIST

Generates an array of TSO CLIST variables. The value of the PREFIX keyword provides the prefix for these variables.

REXX

Generates a series of REXX stem variables. The value of the PREFIX keyword is the stem for these variables.

NOWHERE

Suppresses the return of any command output, either as variables or as display lines.

Optionally, you can specify a second positional parameter, called REPLY, for the CMDRESP keyword. Specifying REPLY causes the response from the REPLY command to be captured. Typically, the response is the REPLY echo and z/OS message IEE600I, but the response can include more if the issuer of the WTOR message requests it (for example, if IMS is the issuer).

The POI ignores invalid values for CMDRESP. Even usually valid values such as REXX and CLIST can be invalid in certain contexts. For instance, if you specify CMDRESP(CLIST) on an OPSCMD that is not issued in a CLIST.

When OPSCMD executes in an OPS/REXX program, command output lines are written to the external data queue only; no stem variables are generated even if you specify CMDRESP(REXX).

When OPSCMD executes in a TSO/E REXX program, command output lines are never written to the external data queue.

When you specify either CMDRESP(CLIST) or CMDRESP(REXX) for OPSCMD, no &SYSOUTLINE variables are generated.

INTERVAL

(Optional) This keyword specifies, in centiseconds, how frequently OPSCMD tests for command response lines to see if the response has ended. The INTERVAL value temporarily overrides the value of the CA OPS/MVS OCINTERVAL parameter.

The default for INTERVAL is the value of the OCINTERVAL parameter, but you can specify any number between 10 and 300, or a value of 0 to bypass interval testing.

MFORM

(Optional) This keyword specifies the format for command output. You can specify MFORM with any system command, but it affects only the output of commands that display information about jobs on the system in multiple lines (one line per job), for example the JES2 $DI and $DA commands.

Specify one of these values for MFORM:

OUTDELIM

(Optional) Use this keyword to specify two values:

A blank is always a delimiter. The defaults are YES and any of the delimiter characters shown here:

'( ) / = , '

Separate the two OUTDELIM operands with a comma, as shown here:

OUTDELIM('@',NO)
PREFIX

(Optional) This keyword defines the prefix for the names of variables generated when you specify the CMDRESP(CLIST) or CMDRESP(REXX) keyword. For CMDRESP(REXX), the PREFIX value provides the stem name of the variables generated.

Default value for PREFIX: CMDOUT

SUBSYS

(Optional) For more information on the SUBSYS keyword, see Specify a Subsystem ID on a POI Command Processor in this chapter.

More information:

Host Environment Commands

Specify a Subsystem ID on a POI Command Processor