OPSVALUE returns a value from the function call, and, in the case of some action codes, also places information in the external data queue.
You can specify the following actioncode values. If you omit the actioncode, then OPS/REXX uses the code V by default.
Note: If you use this function, you will not be able to differentiate between a global variable that has zero as its value and a global variable that does not exist.
Example:
RTVL = OPSVALUE(derivedname,'0'
Example:
RTVL = OPSVALUE(derivedname,'6')
Example:
RTVL = OPSVALUE(derivedname,'A',increment)
Example: To perform the Compare and Update action, four rather than three operands must be used with the 'C' code. The syntax is as follows:
RTVL = OPSVALUE(derivedname,'C',newvalue,oldvalue)
Usage Example: The following example demonstrates how to safely initialize a counter in the )PROC section of a rule using the Compare and Update action code. After possible initialization, the counter is incremented using the Add action code. By using serialized OPSVALUE functions to initialize and increment the counter, this example safely allows for the possibility that multiple tasks running in the same address space may issue message IEF13241 concurrently.
)MSG IEF13241 )PROC /* Load name of OPS job variable used to hold message */ count per job. */ counter='GLVJOBID.IEF13241' /* */ /* Initialize the counter if it does not exist (i.e. */ /* this is the first IEF13241 message to be issued by */ /* this job since this rule was enabled.) To allow for */ /* the possibility that another task in this same job */ /* has simultaneously issued another "first" IEF13241 */ /* message and is executing this same rule concurrent */ /* to this task, use the serialized OPSVALUE Compare and */ /* Update function: */ Temp = OPSVALUE(counter,'C',0,counter) /* We do not care about the success of the above Compare */ /* and Update. It will succeed only the first time that */ /* it is executed by this job. In that case, since the */ /* variable does not yet exist, OPSVALUE will create the */ /* variable and give it a value of its own name, causing */ /* the Compare to succeed and the value to be Updated */ /* to 0. The Compare will fail for all subsequent */ /* executions by this same job, since the variable will */ /* already exist, and its value will not be equal to its */ /* own name. In that case, the variable may have been */ /* initialized days ago by a task that is no longer */ /* attached, or it may have been initialized a */ /* microsecond ago by a task that is executing this same */ /* rule concurrent to this task. It does not matter. */ /* The counter is initialized only once per job. */ /* */ /* Increment the counter by 1. To allow for the */ /* possibility that another task in this same job has */ /* simultaneously issued another IEF13241 message and is */ /* executing this same rule concurrent to this task, use */ /* the serialized OPSVALUE Add function: */ temp = OPSVALUE(counter,'A',1) RETURN
Example:
RTVL = OPSVALUE(derivedname,'D')
Example:
RTVL = OPSVALUE('derivedname','E')
Note: For most types of variables, N and U have interchangeable meanings. However, for global variables, N means that no storage exists for a variable; and U means that the variable exists in storage, but is uninitialized and is set to the value of its name.
I-Initialized
U-Uninitialized
N-does Not exist
When the returned value is not N (meaning that the derived name exists), the value of the node is returned on the external data queue. The maximum length of a string pulled from the external data queue is 350 bytes. CA OPS/MVS truncates longer values.
Example:
RTVL = OPSVALUE(derivedname,'F')
You can use this function from any environment that supports OPSVALUE, such as REXX programs, rules, GEM, and OPSLINK; however, for this function to be useful for OPSVALUE or ADDRESS SQL, you must use it in an OPS/REXX program.
For OPSVALUE requests, you must specify one of the following values for the derivedname variable:
GLOBAL.READONLY
GLOBAL.READWRITE
For ADDRESS SQL requests, you must specify one of the following values for the derivedname variable:
GLOBAL.SQLREADONLY
GLOBAL.SQLREADWRITE
AUTH-The request is permitted.
NOTAUTH-The request is denied (no error message is issued).
When the AUTH value is returned, subsequent OPSVALUE or SQL calls from the OPS/REXX program will not create the type of OPSGLOBAL or SQL security events that correspond to the authority level that was obtained on the preceding high-level security call. For example:
A (Access)-If you specify GLOBAL.READONLY or GLOBAL.SQLREADONLY
U (Update)-If you specify GLOBAL.READWRITE or GLOBAL.SQLREADWRITE
Examples:
RTVL = OPSVALUE('GLOBAL.READONLY','H')
RTVL = OPSVALUE('GLOBAL.READWRITE','H')
RTVL = OPSVALUE('GLOBAL.SQLREADONLY','H')
RTVL = OPSVALUE('GLOBAL.SQLREADWRITE','H')
The derivedname value must be a compound symbol node. The return value is the number of immediate subnodes that exist. The external data queue contains two lines per subnode: the first line contains the next segment of the derived name, and the second line contains statistics about the derived name. The second line returned for each derived name contains the following information. The first piece of information indicates the word number, the second indicates the length of the word, and the third describes the word.
Example:
RTVL = OPSVALUE(derivedname,'I')
Returns a count of all the immediate subnodes of derivedname.
This action returns the same result value as the I or L action codes. However, the external data queue is not modified.
Example:
RTVL = OPSVALUE(derivedname,'J')
Returns a count of all the subnodes of the derivedname
The result value returned by this action is the same value returned by the S or T action code. However, the external data queue is not modified.
Example:
RTVL = OPSVALUE(derivedname,'K')
The results of this action illustrate the difference between dropped symbols (processed by action D) and removed symbols (processed by action R). Dropped symbols still exist, so the List action can find them. The List action does not return removed symbols.
Example:
RTVL = OPSVALUE(derivedname,'L')
Note: If you use this function, then you will not be able to differentiate between a global variable that has a null string as its value and a global variable that does not exist.
Example:
RTVL = OPSVALUE(derivedname,'N')
Example:
RTVL = OPSVALUE(derivedname,'O')
Example:
RTVL = OPSVALUE(derivedname,'R')
Example:
RTVL = OPSVALUE(derivedname,'S')
The derivedname value parameter must be a compound symbol node. The return value is the number of subnodes that exist. The external data queue contains two lines per subnode: the first line contains the next segment of the derived name, and the second line contains statistics about the derived name. The second line contains the following information-the first piece of information indicates the word number, the second indicates the length of the word, and the third describes the word.
Action code T resembles code I with three differences:
Example:
RTVL = OPSVALUE(derivedname,'T')
Example:
RTVL = OPSVALUE(derivedname,'U',newvalue)
Example:
RTVL = OPSVALUE(derivedname,'V')
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |