Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Event exit SHUT

SHUT exits are called when the application program is terminated (e.g. as a result of PEND ER). You can use SHUT exits, for example, to close your own files.

The event exits SHUT are called in the order of the corresponding EXIT statements in the KDCDEF file.

Programming notes

  • You can access the KB header and SPAB in this event exit, but the KB program area and the SPAB do not contain any relevant data. openUTM enters the transaction code "SHUTDOWN" for this exit program in the KCTACVG/kccv_tac and KCTACAL/kcpr_tac fields of the KB header.

  • If you use other shared storage areas (AREAs), you can access them in the SHUT exit. For more information refer to the following sections: "Other data areas (AREAs)" and and item "Extending the LINKAGE SECTION" in section "COBOL program units as subroutines".

  • If the application terminates normally, openUTM enters the service indicator "L" in the KCKNZVG/kccv_status field for the final process of the application, otherwise a blank.

  • The event exit SHUT must not use KDCS calls.

  • You can exit the event exit SHUT with a return statement.

BS2000 systems

  • If an error occurs in the event exit SHUT (e.g. because of an attempt to open a non-existent file), the event exit SHUT can be terminated. Before doing so, however, you should first issue a message that you are going to terminate the program. If the application program is to be terminated and a USERDUMP is to be written you can, for example, call a short Assembler program in which you first call the CDUMP macro and then call TERM with the operand UNIT=STEP.

Generation notes

  • The programs for the event exits SHUT must be defined at generation with the EXIT statement using the operand USAGE=SHUT.

  • A maximum of 8 event exits SHUT are allowed per application.

This version enables you to use several SHUT exits and thus allows you to work better with preconfigured or purchased application components, which often have their own START and SHUT exits. These can now be processed one after the other. In addition, as an application operator, you can also add your own SHUT exits.

For an example of how an event exit SHUT can be used in C or COBOL, see "Additional information for C/C++: Example of a complete UTM application on BS2000 systems" and "Additional information for COBOL: Example of a complete UTM application on BS2000 systems".