Previous Topic: Complex ActionsNext Topic: Built-in Variables


Specify Variables in Action Clauses

CA OPS/MVS lets you specify variables in an action clause. This product enables variables 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.

When you use the first method (ampersand prefixed variable name), CA OPS/MVS provides a substring functionality to extract desired substring from the variable name.

To use the first method, you specify variables in a manner similar to TSO/E CLIST syntax:

  1. Place an ampersand (&) as the first character of the variable name.
  2. The first invalid character terminates the variable name.
  3. A period (.) following the variable name indicates concatenation with subsequent text.
  4. To include an ampersand character (&) as part of the text, enter two ampersands together.
  5. To use a substring functionality, specify starting position and length in the following notation: &varname(start,length).
  6. If the variable name is not a column name in the directory or resource table, the variable name is assumed to be a CA Automate rules variable that has been processed by the CA OPS/MVS rules converter. The prefix table that the ATM*SCOPEnn parameters establish are searched and the appropriate converted variable name is used to find the variable value. If the variable does not exist, a null string is substituted. Quotes have no special meaning as the command text is being scanned for variables.

To use the second method for specifying action text variables follows the rules of REXX host command string processing:

  1. All text in quotation marks, either single (') or double ("), remain as entered.
  2. Text outside of quotes can be treated as a variable name.
  3. Strings of valid variable names are evaluated for substitution as column names or global variables.
  4. Characters that are not valid variable names remain as entered.
  5. Multiple blanks are reduced to a single blank.
  6. A uninitialized variable is treated as the value of its own name.

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 an inadvertent variable substitution, enclose all command text in quotes in the action keyword specification.

Example: Variables that are 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 command:

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

The following command text string is the DB2 START command.

MVSCMD("-&JOBNAME(1,4) START DB2”)

To start a DB2, use the DB2 command prefix which in most cases have the first four letters of the master address space. In this example, if the JOBNAME column in the resource table has the value of DB2PMSTR following command is submitted to MVS:

-DB2P START DB2

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 that the SSMGLVPREFIX parameter sets, which you set independently on each system.

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