Previous Topic: OPS/REXX Host EnvironmentsNext Topic: AOF RETURN Statement


OPS/REXX Built-in Functions

These built-in functions are part of OPS/REXX that gives these AOF rules access to a wide variety of system data for programmatic actions. In some cases, certain OPS/REXX functions can perform specific system tasks. OPS/REXX functions can retrieve a system information, such as job status, device status, or JES2-related resource data. OPS/REXX functions can also perform such tasks as low lighting messages or invoking z/OS Automatic Restart Management Services.

You can use the following OPS/REXX built-in functions in these AOF rules:

OPSAPI

Lets you create a Generic Event API CA OPS/MVS event from any supported REXX environment.

OPSARM

Performs z/OS Automatic Restart Management Services.

OPSARMST

Determines whether a single job or element name is registered with ARM.

OPSCA7

Issues commands to the CA 7 scheduling product.

OPSCAWTO

Creates an SNMP trap.

OPSCLEDQ

Empties the contents of the External Data Queue (stack)

OPSCOLOR

Changes the color of OPSLOG (or console) messages.

OPSCPF

Obtains z/OS Command Prefix Facility information.

OPSDEV

Obtains device information.

OPSDOM

Deletes highlighted operator messages.

OPSECURE

Returns security package related information.

OPSHFI

Reads or writes variables to a shared VSAM file.

OPSINFO

Returns various system and CA OPS/MVS information.

OPSIPL

Obtains various IPL parameter library information.

OPSJES2

Obtains JES2 related resource data.

OPSLOG

Retrieves OPSLOG data.

OPSMTRAP

Generates a warm- or cold-start SNMP trap.

OPSPRM

Controls CA OPS/MVS parameters.

OPSSEND

Sends messages to OPSLOG or other copies of CA OPS/MVS.

OPSSMF

Creates SMF records.

OPSSRM

Collects System Resource Manager (SRM) data.

OPSTATUS

Obtains active ASID, WTOR, IMS, or WLM information.

OPSUBMIT

Builds and submit batch jobs.

OPSSYSYM

Obtains z/OS system symbol information.

OPSVALUE

Manipulates variables.

OPSVASRV

Manipulates SYSPLEX variables.

For complete descriptions and coding guidelines for each OPS/REXX built-in function, as well as a list of valid rule types in which each can execute, see the CA OPS/MVS Command and Function Reference.

Example: AOF Rule Using Built-in Functions

The following AOF rule uses OPS/REXX host environments and built-in functions:

)TOD 02:00
)INIT
/* This rule should only be active on SYSA. Use the OPSINFO       */
/* built-in function to get the SMFID of this system to see       */
/* if the rule should be enabled or not.                          */
if OPSINFO('SMFID') <> 'SYSA' then
  return 'REJECT'

)PROC
/******************************************************************/
/* Rule purpose : Set up Z initiators for batch window            */
/* TOD rule spec fires every 2:00 AM                              */
/******************************************************************/

/* Issue info message using ADDRESS WTO OPS/REXX                  */
/* Host Environment to let everybody know of change.              */
msgtxt= 'Initiators configured to handle 2:00 Batch Flow'
ADDRESS WTO                 
"MSGID(OPSAUTO1) TEXT(' "msgtxt" ') ROUTE(2)" 

/* Let's start all drained 'Z' initiators. We'll obtain this info */
/* by using one of the options on the OPSJES2 built-in function.  */
/* Then we'll use the ADDRESS OPER OPS/REXX host                  */
/* environment to issue a command to JES.                         */
ZINITS=OPSJES2('I','INIT','Z','D')            
do ZINITS                 /* Loop for all drained Z' inits        */ 
  pull RECORD             /* Obtain data from the EDQ             */ 
  INITID=WORD(RECORD,1)   /* First word is init id                */ 
  address OPER            /* Switch to ADDRESS OPER               */ 
  "C($SI"INITID") NOO"    /* Issue JES2 $Six command              */ 
end                       /* End of DO                            */