EXIT Data Source

The EXIT data source extends the data element resolution process to include data sources and data acquisition techniques that you define. The EXIT keyword includes an operand that specifies the name of the data element resolution routine you supply.

You can modify the operation of the EXIT data source by including the EXAMINE qualifier.

EXAMINE
Specifies that the resolution routine is to be given control to examine or modify the corresponding data element, regardless of whether a value has been acquired from another data source. When EXAMINE is omitted, the resolution routine is invoked only if a value has not already been acquired. The EXAMINE keyword has no operands.

An example of a site-written resolution routine can be found in &thilev.SKLSSAMP(KLGXELEM).

The sample exit routine illustrates coding guidelines and highlights basic concepts. KLGXELEM calls TGMACLIB(KLG#GEPL), which provides a parameter list for the exit. Most parameters in the list point to data elements to be resolved during the exit.

Parameter Points to
AREA User work area address
STR String address
STRLN String length
PHYSN Physical node name
VIRTN Virtual node name
APPL Application name
USER USERID string pointer
APLST APPLIST string pointer
PNODE PRTNODE string pointer
PLTRM PRTLTERM string pointer
LTERM LTERM string pointer
DEST DEST string pointer
LMODE LOGMODE string pointer
DATA USERDATA string pointer
POOL POOL string pointer
IBUSD Inbound USERDATA string pointer
GROUP GROUP string pointer
ACCT ACCOUNT string pointer
PROC PROC string pointer
DIALG Dialog service
AUB Active user block

Some exit parameters point to a length followed by the data; these include APLST, DATA, DEST, IBUSD, LMODE, LTERM, PLTRM, PNODE, POOL, and USER.

Other exit parameters point to an 8-character string (padded with blanks on the right, if necessary); these include APPL, PHYSN, and VIRTN.

In coding your own exit routines, keep in mind the following sequence of data element resolution:

  • USERID is always the first element resolved.
  • APPLIST must be resolved before DEST.
  • DEST must be resolved before LOGMODE, LTERM, POOL, PRTLTERM, PRTNODE, and USERDATA.

You can invoke KLK$$MAC of TGMACLIB at the beginning of any exit and then use the $USREXIT macro to get variables, manage memory, and use dialog services. A z/OS® LOAD can also be performed during an exit, provided there is enough RESERVE space available in the address space. See RESERVE.

In the example shown below, the site has supplied a resolution routine for the APPLIST data element. The USERDATA data source indicates that an APPLIST designation may also be available in the userdata string passed to the gateway. The EXAMINE qualifier allows the resolution routine to inspect and/or replace the APPLIST name, even if the APPLIST name was provided in the userdata string.


    APPLIST        USERDATA('APPNAME')      EXIT(APPEXIT)      EXAMINE

For an example of a destination exit, see &rhilev.RLSSAMP(KLSXMSGS).