Member event codes for initialization and termination

Language Environment calls the event codes listed in Table 1 for preinitialization and for batch initialization. Language Environment calls member-specific initialization (MSI) routines for process initialization and again for enclave initialization. The resources and capabilities differ between the two events. For a description of the calling method, see Language Environment member list and event handler. (CICS® initialization is discussed in Subsystem considerations.)
Table 1. Event codes called for initialization and termination
Event Overview
Process Initialization Event The process initialization event code is 17. This event is used to bring up HLL portions at the process level. The order in which the member event handlers are called is undefined. In particular, the dependency list is not honored. For a description of the parameters, see Event code 17 — process initialization event.
Process Termination Event The process termination event code is 21. This event is used to terminate HLL portions at the process level. The order in which the member event handlers are called is undefined. In particular, the dependency list is not honored. For a description of the parameters, see Event code 21 — process termination event.
Enclave Initialization Event The enclave initialization event code is 18. This event is used to initialize HLL portions at the enclave level. The order in which the member event handlers are driven is first based on the ascending order of the member identifier. However, if the member identifier is identified by a numerically lower ID in the dependencies part of the signature CSECT it could be called prior to a lower ID. For more information about the signature CSECTs, see Signature CSECT. For a description of the parameters, see Event code 18 — enclave initialization event.
Enclave Termination Event The enclave termination event code is 19. This event is used to terminate HLL portions at the enclave level. The order in which the member event handlers are called is in the reverse order of initialization. The dependencies are determined from the signature CSECTs. For more information about the signature CSECTs, see Signature CSECT. For a description of the parameters, see Event code 19 — enclave termination event.
Runtime Options Event The runtime options event code is number 4. This event has limited capabilities. There is no stack available, nor any Language Environment callable services. The purpose is to allow the members to handle runtime options in a compatible fashion. For a description of the parameters, see Event code 4 — runtime options event.
Atterm Event The atterm event code is number 15. The atterm event is called during termination of an enclave. It is called after all user stack frames have been removed from the stack and prior to calling the members for the enclave termination event. Only the members that have been explicitly registered using the CWI CEEATTRM is called. For a description of the parameters, see Event code 15 — atterm event.
Note: For information on Language Environment return codes, reason codes, existing language semantics, processing, and conventions, refer to z/OS Language Environment Programming Guide.
Language Environment expects its registers to be restored to their original value upon return, conforming to normal calling conventions. The event handler must set the return code in R15 to one of the valid return codes (in decimal), as follows:
-4
No action was taken for this event.
0
The termination event was successfully processed.
16
The event was not successfully processed and/or the program must be immediately terminated.

Language Environment abends the program if the event handler returns a value of 16 or a value not in the preceding list.

During initialization, Language Environment determines the members present in the application by interrogating the language list identifying those members present in the application and that require member-specific initialization. Each member found in the list has its event handler routine (CEEEVnnn) loaded and called by Language Environment initialization in AMODE 31. The address of each event handler routine is stored into the Language Environment member list at the enclave level.

Language Environment expects a return in AMODE 31, and its registers to be restored to their original values using normal calling conventions. If an exception occurs during the execution of an MSI routine, the Language Environment exception manager issues an ABEND 4093 and the Language Environment environment terminates.

If there are multiple occurrences of a member within an enclave, its MSI routine is called only once per enclave. In addition, the order in which the MSI routines are called is determined from the list of member identifiers contained within the signature CSECTs.

If the MSIs need to be called in a specific order, it is indicated in the signature CSECT. For the format of the signature CSECT, see Figure 1. Language Environment calls the MSI routines in the order dictated by the signature CSECTs. Termination is performed in the reverse order. If the signature CSECTs do not indicate any dependencies, the order of MSI invocation is undefined.