Previous Topic: OPSLINK Function CallsNext Topic: Execute Operator Commands


Execute TSO Commands

You can execute TSO commands by calling OPSLINK with the following arguments:

CALL OPSLINK('OPSTSO',
             SYSID,
             SUBSYS,
             CMDSTR
             [,LINECOUNT
             [,ARRAY
             [,DDNAME ]]])

You can execute TSO commands only if the calling program is running under the TSO Terminal Monitor Program (TMP) interactively or in batch.

CALL OPSLINK statements that execute TSO commands can have these arguments:

SYSID

The eight-character ID of the system where the TSO command should execute. If you specify a value of all blanks or all binary zeroes, the local system is assumed (the one on which the calling program is running). The name used will be the uppercased version of the one passed.

Note: This parameter is currently ignored.

SUBSYS

The four-character subsystem name of the target CA OPS/MVS subsystem that should process this request. The name used will be the uppercased version of the one passed.

Note: This parameter is currently ignored.

CMDSTR

The TSO command to be executed. The command can include a leading percent sign (for implicit execution of CLISTs). The maximum length of the command string is 256 characters.

LINECOUNT

A fullword binary value that indicates the maximum number of output lines to be returned in the ARRAY argument (see below). The value should be non-negative. If zero is specified, the default is used. If you specify the LINECOUNT parameter, you should also specify the ARRAY parameter. The number of lines actually placed in the output array by OPSLINK is returned in this field.

You should not use a constant in the calling sequence; instead, use the name of a program variable for this argument. Also, before each subsequent OPSLINK call, you must reinitialize this variable to the maximum number of lines that the array can hold.

ARRAY

A character string array in which the output from the request is returned.

DDNAME

An eight-character string specifying the ddname to which output will be redirected before it is placed in the output array. This operand is optional and if omitted will result in dynamic allocation of a VIO data set to hold the TSO command output.

If you intend to issue a sequence of TSO commands, you can improve performance by pre-allocating a VIO (or disk) data set and passing its ddname to OPSLINK. The ddname actually used by OPSLINK is returned in this field.

You should not use a constant in the calling sequence; instead, use the name of a program variable for this argument.