Previous Topic: Complex Actions

Next Topic: Built-in Variables

Specify Variables in Action Clauses

CA OPS/MVS enables you to specify variables in an action clause. It does this by assigning values to the variables when SSM initiates the action in the clause.

You can specify action text variables in two ways. The first method is compatible with previous versions of SSM, and the second method follows the rules of REXX host command string processing.

To specify variables in action clauses

When CA OPS/MVS evaluates action text, it first evaluates according to the TSO/E CLIST method, and then evaluates again using the REXX syntax method. To prevent inadvertent variable substitution, enclose all command text in quotes in the action keyword specification.

Example: Variables specified in action clauses

The following command text string is enclosed in quotes to prevent variable substitution.

TSOCMD("OPSCMD COMMAND(START &JOBNAME..&JOBNAME) NOOUTPUT
SUBSYS("GLOBAL0.MYSUB")")

In this example, if the JOBNAME column in the resource table has the value of RMF and the GLOBAL0.MYSUB variable has the value OPSX, then the following command is submitted to the server:

OPSCMD COMMAND(START RMF.RMF) NOOUTPUT SUBSYS(OPSX)

For a DB2 subsystem that uses a quotation mark (") as a command character, suppose that you have this action text:

TSOCMD("OPSCMD COMMAND(OI STOPDB2 CMDCHAR("")) JOBNAME("JOBNAME")")

This text yields the following:

OPSCMD COMMAND(OI STOPDB2 CMDCHAR(") JOBNAME(DSN2MSTR)

Shorthand global variables can also be used. These variables have the format &.varname. SSM resolves these variables by replacing the ampersand (&) with a system-specific prefix, and then treating them as global variables. The system prefix is set by the SSMGLVPREFIX parameter, which you should set independently on each system.

During the REXX substitution phase of action text processing, the & may be omitted if the variable name is not embedded in a quoted string.