Previous Topic: Execute Operator CommandsNext Topic: Codes for the OPTION Argument


Access and Update Global Variables

You can access or update global variables by calling OPSLINK with the following arguments:

CALL OPSLINK('OPSGLOBL',
               SYSID,
               SUBSYS,
               VARNAME
               [,LINECOUNT
               [,ARRAY
               [,OPTION
               [,VARVALUE
               [,OLDVALUE ]]]])

Note: This subfunction call is equivalent to the OPSVALUE() REXX function call to access/update global variables from in REXX programs and AOF rules. Results normally returned in the external data queue by the OPSVALUE() function are returned in the output ARRAY (if any) instead.

Arguments you can use in CALL OPSLINK statements that operate on global variables are:

SYSID

An eight-character system ID where the request should be executed. 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.

VARNAME

The name of the global variable. This name must start with a valid global variable prefix (GLOBAL or GLVTEMP). No substitution of qualifiers is made for the compound symbol. For additional information on global variables see the chapter titled Global Variables Explained in this book.

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, also specify the ARRAY parameter. The number of lines actually placed in the output array by OPSLINK is returned in this field.

Instead of using a constant in the calling sequence, 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.

OPTION

A one-character string containing a code that represents the operation you want to perform on a global variable.

Note: The OPTION code is related to the equivalent OPS/REXX OPSVALUE function action code. For additional information, see the OPSVALUE documentation.

VARVALUE

A character string variable in which the current value of the specified global variable is returned (options O and V), or which contains the new value for a global variable (options A and U only). The string variable should be large enough to contain a string of 256 characters.

Instead of using a constant in the calling sequence, use the name of a program variable for this argument. Also, before each OPSLINK that retrieves a value (options O and V), you must reinitialize the length of the string to its maximum size.

OLDVALUE

A character string variable in which the current or old value of the specified global variable must be specified and is used for verification prior to update (option C). This argument must only be specified for option C.