LOCAL variables usage and pools
This pool is created when an EXEC is assigned to a thread and is deleted when the thread terminates.
Variables in this pool are created by
- Using the IMFEXEC command VPUT to move TSO variables into the LOCAL pool
- Using IMFEXEC CMD with the RESPONSE capability to issue MVS commands (refer to CMD Type(MVS) — Issue MVS command with response) and by invoking SYSPROG services using the IMFEXEC RES command
The LOCAL pool is useful for passing variables between EXECs executing within the same thread (for example, EXEC-initiated EXECs where WAIT(YES) is coded). For example, the calling EXEC includes an IMFEXEC VPUT statement to put variables from the TSO pool into the LOCAL pool. Then, the called EXEC can operate on those variables by using IMFEXEC VGET to get those variables from the LOCAL pool into the TSO pool.
REXX EXEC example:
N=1 /* creates a TSO variable in TSO pool*/
'IMFEXEC VPUT N LOCAL' /* IMFEXEC VPUT cmd places variable in LOCAL pool*/
'IMFEXEC VPUT N LOCAL' /* IMFEXEC VPUT cmd places variable in LOCAL pool*/
CLIST example:
SET &N=1 /* SET command creates a TSO variable in TSO pool*/
IMFEXEC VPUT N LOCAL /* IMFEXEC VPUT cmd places variable in LOCAL pool*/
IMFEXEC VPUT N LOCAL /* IMFEXEC VPUT cmd places variable in LOCAL pool*/
These examples store variables from the TSO pool to the LOCAL pool.
Local variables are not available to EXECs scheduled by the REXX CALL function.
Related topic
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*