This function retrieves and sets values for variables that exist in the external REXX subroutines that called the current routine.
value = VVALUE({FETCH|STORE},varname,level,[newvalue])
Parameters
Value of the specified variable, if this is a fetch operation. Otherwise null or error text.
Returns the current contents of a variable.
Replaces the contents of the variable with the specified value.
Name of the variable to be referenced.
Subroutine nesting level to be accessed. 0 is the currently executing routine, 1 is the caller of the currently executing routine, 2 is the caller of the caller of the currently executing routine, and so on.
Value to be placed in the specified variable (STORE operation only).
ARG n MISSING OR INVALID
ARG 3 EXCEEDS NESTING LEVEL
SYSTEM ERROR
STORAGE DEPLETED
UNKNOWN SEVERE ERROR
SYSTEM ERROR, INVALID RETURN
VARIABLE DID NOT EXIST OR IS DROPPED
LAST VARIABLE TRANSFERRED ("N")
TRUNCATION OCCURRED
INVALID VARIABLE NAME
INVALID VALUE SPECIFIED
INVALID FUNCTION CODE (SHVCODE)
Example
/* This IMOD gets called repeatedly. It requires extensive initialization to derive a value for "num". Instead of performing this initialization each call, the value of "num" is stored in the calling IMOD. */ num = vvalue('fetch','shar_init',1) /* obtain stored number */ if rc ^= 0 | datatype(num,'w') == 0 then do /* nothing stored */ call init /* invoke 10,000 line internal init subroutine */ x = vvalue('store','shar_init,1,num) /* save for next time */ end
Copyright © 2014 CA Technologies.
All rights reserved.
|
|