Previous Topic: OPSSRM FunctionNext Topic: ASID Records That OPSTATUS Returns


OPSTATUS Function

The OPSTATUS function returns a count of the address spaces currently in the system or in the *LOGON* state, outstanding WTORs, or IMS systems that are currently in the system and that match the selection criteria. OPSTATUS also optionally writes one or more records to the external data queue.

OPSTATUS is useful for retrieving either the names of address spaces that are active or have outstanding replies, or the IMS IDs of active IMS systems.

Note: Using the OPSTATUS function to count the number of batch jobs from a $HASP message rule cannot provide you with accurate results. The message can be issued on behalf of a batch job before the OPSTATUS function counts it or after OPSTATUS counts it. Batch jobs can show up as active before the program is executing, or after the program has finished executing but before JES has finished handling work on its behalf. The OPSTATUS function can be used in OPS/REXX or AOF rules.

OPSTATUS has the following format:

var = OPSTATUS(func, subfunc, entity,[system])
func

Specifies the type of entity whose status you want to query; func has one of the following values:

A

Address spaces

I

IMS systems

J

Batch jobs

P

Attached APPC transactions (ATX)

R

Outstanding replies (WTORs)

S

Started tasks and system address spaces

T

TSO users

subfunc

The subfunc argument specifies one of these information types:

A

Based on the function code used, returns only the count of address spaces, outstanding WTORs, or IMS systems that match the selection criteria. No records are added to the external data queue.

L

Returns the count and add a WTOR or IMS record to the external data queue for each WTOR or IMS system found. A subfunction of L is valid only for function values of R (WTORs) and I (IMS systems).

I

Returns the count and do the following:

  • For function values of A, J, P, S, or T, add an ASID record to the external data queue for each address space found.
  • For a function value of I, add an IMS record (followed by an ASID record) to the external data queue for each IMS system found. The ASID record identifies the IMS system.
  • For the function value R, add a WTOR record (followed by an ASID record) to the external data queue for each outstanding WTOR found. The ASID record identifies the issuer of the WTOR.
S

Returns the count and add two records to the external data queue for each outstanding WTOR in the sysplex. The first record contains information about the WTOR and is identical to that returned by the L subfunction. The second record identifies the WTOR issuer on the originating system and indicates how long the WTOR has been outstanding. A subfunction of S is valid only for a function value of R (WTORs).

W

For function values of A, J, P, S, or T, adds an ASID Workload Manager record to the external data queue for each address space that matches the selection criteria.

A subfunction of W is not valid for function values of I (IMS systems) and R (WTORs).

X

Returns the count and adds the following two records to the external data queue for each WTOR on the local system that also originated from the local system:

  • The first record is the WTOR itself.
  • The second record identifies the WTOR issuer and indicates how long the WTOR has been outstanding.

A subfunction of X is valid only for a function value of R (WTORs).

entity

This argument restricts the returned information to only those entities with names matching the value of entity. Entity can be:

For all function codes except I, the entity name refers to the jobname/TSO ID/started task name of each address space. For function code I, entity names refer to the four-character IMS ID of each IMS system.

system

(Optional) Enables CA OPS/MVS to execute the OPSTATUS function on external systems that have been defined to the MSF. The MSF establishes VTAM or CCI sessions between copies of CA OPS/MVS, permitting any copy to issue a command on any other copy and to receive its response.

Valid values for system are:

If the local MSF system name is used or implied, the system argument is ignored.

The number of seconds that the function waits for a response is determined by the ADDRESS OPSCTL MSF DEFAULT SYSWAIT value when it is greater than zero or the value of the MSFSYSWAIT parameter.

When the system argument is specified for a remote system within a no-wait AOF rule, no output for the function is returned.

An invalid or inactive MSF system name causes the REXX program to be interrupted for a SYNTAX error. Use the ADDRESS OPSCTL MSF LIST HOST command to validate the MSF system name before using it as an argument for any REXX function.

Example: Use the OPSTATUS Function

This example uses OPSTATUS function to determine whether the CICSPROD address space is active on SYSB.

jobname = "CICSPROD"
ADDRESS OPSCTL “MSF DEFAULT SYSWAIT(30)”
status = OPSTATUS("A","A",jobname,'SYSB')
if status=1 then TASKSTAT = "UP"