Start of change

Monitoring dynamic exits processing

Dynamic exits services allow exit routines to be associated with (add) or disassociated from (delete) an exit. Because any product can own exits and have an interest in learning about exit routines for their exit, an exit (CSVDYNEX) is provided from dynamic exits services. It provides information about the exit routine and exit being processed. The exit is primarily intended to be used as a notification mechanism so that products can learn quickly of changes that might affect whether or not they should make an exit call.

The system takes no action as a result of exit routine processing.

CSVDYNEX exit routine processing

The CSVDYNEX exit routine, if defined, receives control when the system processes a dynamic exit services Add, Modify, Replace, or Delete request, in one of the following ways:
  • The CSVDYNEX macro
  • The SETPROG EXITS operator command
  • An EXIT statement within PROGxx referenced by the SET PROG=xx operator command

Dynamic exits services are documented in z/OS MVS Programming: Authorized Assembler Services Reference ALE-DYN. The CSVDYNEX exit routine can be used to update control structures that track whether or not there are exit routines associated with a given exit.

Installing CSVDYNEX

Use the CSVDYNEX macro to connect an exit routine to the dynamic exits processing. For example:

              CSVDYNEX REQUEST=ADD,                 X
                    EXITNAME=THEEXIT,               X 
                    MODNAME=THEMOD
       .
       .
       .
     THEEXIT  DC CL16'CSVDYNEX'
     THEMOD   DC CL8'DYNEXRTN'

The exit routine must be reentrant and AMODE 31.

See Using dynamic exits services for a description of CSVDYNEX processing.

CSVDYNEX exit routine environment

The exit routine receives control in the following environment:
  • In supervisor state with PSW key 0.
  • In dispatchable unit mode of task, running under the task and request block of the caller of CSVDYNEX.
  • In cross memory mode of PASN=HASN=SASN.
  • In AMODE 31.
  • In primary ASC mode.
  • Enabled for I/O and external interrupts.
  • With no locks held.
  • With parameter areas in the primary address space.
  • The parameter list is described below.
  • In the address space in which CSVDYNEX REQUEST=ADD was issued, or the master scheduler address space for the SETPROG or SET PROG operator commands.
  • With ENQ resource SYSZCSV.CSVDYNEX held exclusive.

Do not use CSVDYNEX services within the exit routine.

CSVDYNEX exit routine recovery

The exit routine should provide its own recovery, using ESTAEX or SETFRR EUT=YES. If the exit routine ends abnormally, its recovery routine will get control before the recovery routine established by the CSVDYNEX service.

You can use the ADDABENDNUM and ABENDCONSEC parameters on the CSVDYNEX REQUEST=ADD macro to limit the number of times the exit routine abnormally ends before it becomes inactive. An abend is counted under the following conditions:
  • The exit routine does not provide recovery, or the exit routine does provide recovery but percolates the error.
  • The system allows a retry, that is, the recovery routine is entered with bit SDWACLUP off.

By default, the system disables the exit routine when it abends on two consecutive calls.

Programming considerations

  • Invoke CSVDYNEX MF=L to get a mapping of the input parameters and equate symbols for use by the exit routine.
  • Code the exit routine to be reentrant and to have AMODE 31.
  • The exit routine should not modify the parameter areas.
Registers at entry to CSVDYNEX exit routine: The contents of the registers on entry to a CSVDYNEX exit routine are:
Register
Contents
0
Contains no information for use by the exit routine
1
Address of a parameter list of 1 word.

Parameter List 1st word: address of a copy of the CSVDYNEX parameter list being used. Use CSVDYNEX MF=L to get a mapping of this area.

2-12
Contains no information for use by the exit routine
13
Address of 72-byte standard save area
14
Return address
15
Entry point address
Registers at exit from CSVDYNEX exit routine: Upon return from CSVDYNEX processing, the register contents must be:
Register
Contents
0-1
Need not contain any particular value
2-13
Restored to contents at entry
14
Need not contain any particular value
15
0

Dynamic exits parameter list data

The fields of primary interest are expected to be (assume that CSVDYNEX MF=(L,PL),PLISTVER=MAX is used, which will cause field names to begin with “PL_”):
  • The request type (byte PL_XRequest) with values identified by equates such as PL_XRequest_Add, PL_XRequest_Modify, PL_XRequest_Replace, PL_XRequest_Delete.
  • The exit name (16-character field PL_XExitName).
  • The service mask (8-character field PL_xServiceMask). This field is valid only when bit PL_Keyused_ServiceMask in byte PL_xAMRFlags is on, which in turn is possible only for the request types that accept ServiceMask (it is not valid for a delete request).

Disassociating CSVDYNEX

Disassociate the exit routine from CSVDYNEX when it should no longer receive control. Use the CSVDYNEX macro to disassociate the exit routines. You can DELETE the exit routine or you can MODIFY the exit routine to an inactive state. For example:

              CSVDYNEX REQUEST=DELETE,                                      X
                    EXITNAME=THEEXIT                                        X
                    MODNAME=THEMOD
       .
       .
       .
     THEEXIT  DC CL16'CSVDYNEX'
     THEMOD   DC CL8'DYLPARTN'

Example

EXITRTN  CSECT
EXITRTN  AMODE 31
EXITRTN  RMODE ANY
*
* entry linkage
*
         STM   R14,R12,12(R13)
         LR    R12,R15
         USING EXITRTN,R12
         USING DYNEX_PARMLIST,R1
*
* Processing
*
         CLC   DYNEXPL_XEXITNAME,EXITNAME     Our exit?
         JNE   DONE            No, Done
         CLI   DYNEXPL_XREQUEST,DYNEXPL_XREQUEST_DELETE DELETE?
         JE    DELETE             Yes, Process Delete
*
* Process Add/Modify/Replace, perhaps set a flag indicating that there is
* an exit routine associate with your exit so that it is now necessary
* to call the exit (since someone may be listening)
*
         J     DONE
DELETE   DS    0H
* Process DELETE 
DONE     DS    0H
*
* exit linkage
*
         LM    R14,R12,12(R13)
         SLR   R15,R15
         BR    R14
EXITNAME DC    CL16'MY_EXIT'
R1       EQU   1
R2       EQU   2
R3       EQU   3
R4       EQU   4
R12      EQU   12
R13      EQU   13
R14      EQU   14
R15      EQU   15
DYNEX_PARMLIST DSECT
         CSVDYNEX MF=(L,DYNEXPL),PLISTVER=MAX
         END
End of change