Using the task token UEPTSTOK
UEPTSTOK is an exit-specific parameter that is passed on a number of user exit points. It provides the address of a 4-byte area that you can use to pass information between successive interval control requests in the same task. For example, if you need to pass information between successive invocations of the XFCREQ exit, you can use UEPTSTOK to do so.
UEPTSTOK is set to address the EISEXITT field (the task lifetime token in the EIS). The expectation is that this field is set to address an area of storage that is used by the exits for the task. As such, this task lifetime storage can potentially be shared between different exit programs for the life of a task.
Unless exit programs cooperate in their usage of UEPTSTOK, unpredictable results can occur when
it is used to address exit-specific data. An approach for sharing this token by multiple exit
programs is as follows:
- The UEPTSTOK token is the first of a chain of addresses, the subsequent editions of which are at the front of each piece of storage chained. Exit programs acquire storage and chain the addresses of this storage from UEPTSTOK.
- Bytes 0-3 of each piece of storage is a pointer to the next piece of storage chained. Bytes 4-11 contain the name of the exit program which acquired the storage (or some other constant identifying whose storage it is).
Note: Typically, exit programs detect that there is not a currently chained piece of storage for
their specific use when driven for the first time by a task, and this makes them acquire and add a
piece of storage to the chain addressed by UEPTSTOK. When they add a piece of storage to the chain,
it can be done to the front or end of the chain; what matters is that the chain is updated to
reflect the newly added storage address and exit identifier.