Previous Topic: Access and Update Global VariablesNext Topic: Return Codes from OPSLINK


Codes for the OPTION Argument

You can specify one of the following codes for the OPTION argument:

6

Delete single global variable

Removes the single global variable specified by VARNAME without removing any of its subnodes. After the operation VARVALUE contains 1 if the node was deleted or a 0 if the node was not found. ARRAY is not modified.

A

Add a value to a global variable

Adds a numeric value, specified by the VARVALUE argument to the existing global variable. If VARVALUE is not numeric the operation fails with return code 41. After the operation VARVALUE contains the sum of the global variable and the increment. ARRAY is not modified.

C

Compare and update

Updates a global variable after verifying its current value against the oldvalue provided. VARVALUE contains 1 if the update was successful or a 0 if the comparison failed. ARRAY is not modified.

D

Drop a global variable

Drops the global variable, see the REXX definition of DROP. The global variable still exists but its value is reset to its uninitialized value. This value is returned in VARVALUE. However, the L call (described below) still lists it. ARRAY is not modified.

E

Check existence of a global variable

Checks the global variable for existence. After the operation, VARVALUE contains one of the following global variable status value characters:

I-Initialized

U-Uninitialized

N-Does not exist

ARRAY is not modified.

I

Return information for a global variable

Returns information about all of the immediate subnodes of the global variable in the ARRAY. Two consecutive array entries are returned for each global variable node. The first entry contains the next segment of the global variable name and the second entry contains information about that global variable. See the OPSVALUE('I') OPS/REXX function for additional details. After the operation, VARVALUE contains the number of processed global variables.

J

Immediate subtree count

Returns a count of all the immediate subnodes of a global variable. ARRAY is not modified.

K

Subtree count

Returns a count of all the subnodes of a global variable. ARRAY is not modified.

L

List the name or names of global variables

List the names of all immediate subnodes for a partial global variable symbol. Returns information about all of the immediate subnodes of the global variable in the ARRAY. See the OPSVALUE('L') OPS/REXX function for additional details. After the operation, VARVALUE contains the number of global variables processed.

N

Return the value of a global variable

Returns a null string if the global variable does not exist. VARVALUE contains the value of a global variable.

ARRAY is not modified.

O

Obtain the value of a global variable

Returns the global variable value in VARVALUE. If global variable does not exist, it is not created, but an error is returned instead - Return code 40. ARRAY is not modified.

R

Remove a global variable

Deletes the global variable and all of its subnodes and the L call (described above) will no longer list it. VARVALUE contains the number of global variables deleted. ARRAY is not modified.

U

Update the value of a global variable

Updates the value of the global variable with the value specified in the VARVALUE argument (see below). ARRAY is not modified.

V

Return the value of a global variable

Returns the value of the global variable in VARVALUE. If the global variable does not exist, it is created, and its name is returned as the value. ARRAY is not modified.