You need to create a new global variable. What are the possible ways to create a variable and assign a value to it?
OPS/MVS
You can create a global variable by using a standard assignment statement with one of the recognized stems.
GLOBAL. or GLOBALx. (where x is 0-9). These are saved across product restarts and system IPLs.GLVTEMPx. (where x is 0-9). These are lost when OPS/MVS terminates.Example:
GLOBAL.MYVAR = "Initial Value"
The OPSVALUE function provides serialization, ensuring that asynchronous tasks do not interfere with each other.
Syntax: temp = OPSVALUE(derivedname, 'U', newvalue)
'GLOBAL.MYVAR').newvalue to the variable. If the variable does not exist, it is created.Example:
/* Creates or updates GLOBAL.COUNTER to 1 */
var_status = OPSVALUE('GLOBAL.COUNTER', 'U', 1)
You can manually create, view, or modify global variables through the OPSVIEW interface:
You can use the OPSSETV command from a TSO environment or within a REXX program to create a variable.
Example:
"OPSSETV NAME(GLOBAL.MYVAR) VALUE(SomeValue)"