Previous Topic: VSAM()Next Topic: WAIT()


VVALUE()

This function retrieves and sets values for variables that exist in the external REXX subroutines that called the current routine.

Syntax

value = VVALUE({FETCH|STORE},varname,level,[newvalue])

Parameters

value

Value of the specified variable, if this is a fetch operation. Otherwise null or error text.

FETCH

Returns the current contents of a variable.

STORE

Replaces the contents of the variable with the specified value.

varname

Name of the variable to be referenced.

level

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.

newvalue

Value to be placed in the specified variable (STORE operation only).

Usage Notes

Return Codes

101 - 104

ARG n MISSING OR INVALID

103

ARG 3 EXCEEDS NESTING LEVEL

121

SYSTEM ERROR

122

STORAGE DEPLETED

123

UNKNOWN SEVERE ERROR

124

SYSTEM ERROR, INVALID RETURN

125

VARIABLE DID NOT EXIST OR IS DROPPED

126

LAST VARIABLE TRANSFERRED ("N")

127

TRUNCATION OCCURRED

128

INVALID VARIABLE NAME

129

INVALID VALUE SPECIFIED

130

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