z/OS JES2 Installation Exits
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Control blocks

z/OS JES2 Installation Exits
SA32-0995-00

An exit routine has access to various control blocks available in the environment from which it was called.

To simplify exit coding IBM-defined exit routines provide in registers 0-13 pointers to control blocks currently in main storage. Register 1 can contain a pointer to a parameter list, which contains the addresses of control blocks currently in main storage. For a list of the specific pointers provided by an IBM-defined exit, see the REGISTER CONTENTS WHEN CONTROL IS PASSED TO THE EXIT ROUTINE category of the particular exit's description. Note that if you install an installation-defined exit, you have to ensure that any pointers required by your exit routine have been placed in the call registers by JES2 before invocation of your exit; this may require some modification of JES2 source code.

An exit routine can access information available in control blocks. For example, IBM-defined Exit 5, which allows you to perform your own JES2 command preprocessing, passes the address of the PCE to an associated exit routine. You can write your own command validation algorithm by writing an exit routine that checks various command-information fields in the PCE.

CAUTION:
Because an exit routine runs fully authorized, it is free to alter any field in any control block to which it has access. By altering specific fields in specific JES2 control blocks, an exit routine can pass information to JES2 and to succeeding exit routines and can thereby affect the course of later JES2 processing. Note that JES2 has no protection against any change made to any control block by an exit routine. If you modify a checkpointed control block, you must ensure that it is written to the checkpoint data set either by your exit routine or by JES2. For this reason, you should exercise extreme caution in making control block alterations.
Avoid expanding JES2 control blocks. Use alternatives such as:
  • Use fields dedicated for installation use that appear in many major control blocks. Place your data, or a pointer to your data, in these fields. However, beware of setting storage address in checkpointed or SPOOL resident control blocks.
  • Use $JCTX services rather than modifying $JCT.
  • Use table pairs and dynamic tables. For example, use dynamic $BERTTABs with CBOFF=* instead of modifying $JQE.
This is a partial list. Evaluate your specific situation and take appropriate action.

Except where it would seriously degrade system performance, JES2 provides a reasonable amount of space in its standard control blocks for use by your exit routines. Some storage-resident control blocks, such as PCEs and DCTs, have storage reserved for exit routine use. You can use this storage to establish your own exit-related field or fields within a standard control block or, if you require more storage, you can use four of the bytes as a pointer to a work area acquired by an exit routine using the JES2 $GETMAIN, $GETBUF, and $GETWORK macros or the MVS™ GETMAIN macro. Disk-resident control blocks provide considerably more space for exit routine use. For performance reasons, no checkpoint-resident control blocks reserve space for use by exit routines.

In addition to using reserved space in the standard JES2 control blocks, you can define and use your own installation-specific control blocks by using the JES2 exit facility. An exit routine can use the JES2 $GETMAIN, $GETBUF, and $GETWORK macros or the MVS GETMAIN macro to acquire storage and build a control block at the appropriate point in processing. For example, a job-related control block can be built by an exit routine associated with IBM-defined Exit 2. You can then use IBM-defined Exits 7 and 8 to write your exit. installation-defined control blocks to spool and to read them from spool into main storage.

Note that if an exit routine references the symbolic name of a control block field, the DSECT for that control block must be requested in the exit routine's module at assembly time (through the $MODULE macro). Each exit description includes a list of DSECTs normally required at assembly.

An exit routine that needs to access checkpoint control blocks must use appropriate access services. See Checkpoint control blocks for more information.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014