START exits are called when the application program is started, when the program is reloaded after a PEND ER or when the entire application program is replaced.
The event exits START are called in the order of the corresponding EXIT statements in the KDCDEF file.
You can use START exits, for example, in order to open files in order to work with them.
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 "STARTUP" for this exit program in the KCTACVG/kccv_tac and KCTACAL/kcpr_tac fields of the KB header.
When the first process of the application is started, openUTM enters the service ID "F" in the KCKNZVG/kccv_status field, otherwise a blank.
If you use other shared storage areas (AREAs), you can access them in the START exit. For more information refer to the following sections: "Other data areas (AREAs)" and item "Extending the LINKAGE SECTION" in section "COBOL program units as subroutines".
The event exit START must not use KDCS calls.
You can exit the event exit START with a return statement.
The additional processes (if there are any) are only started after the first process of an application is started.
If an error occurs in the event exit START (e.g. because of an attempt to open a nonexistent file), the event exit START CAN ensure that the current process is terminated. An error message must, however, always be written beforehand.
Should irrecoverable errors occur during the START exit for the first process in the UTM application and thus prevent the UTM application from running, the START exit routine can only be terminated with exit(-1) (with COBOL85: set RETURN-CODE to -1 and afterwards STOP RUN). The event exit START which starts the UTM application is then aborted.
Unix, Linux and Windows systems
If the START exit for a follow-up process in a UTM application is terminated with exit(-1) (COBOL85: RETURN-CODE to -1 and STOP RUN), the UTM application loses a process. For this reason, the START exit for a follow-up process must never be terminated with exit(-1). Instead, this status must be handled by other program units - if necessary by shutting the process down from the administration interface.
BS2000 systems
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 program unit for the event exit START has to be defined at generation with the EXIT statement and the operand USAGE=START.
A maximum of 8 event-driven START program units are allowed per application.
This version enables you to use several START 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 START exits.