openUTM calls the VORGANG event exit when a service is started or terminated, including incorrect termination and restart.
Even if a service consists of two or more transactions processed in different program units, the same event exit VORGANG which was called at the start of the service is called again at the end of the service.
If VORGANG is called at the end of a service, but an error occurs at this time, the last transaction of the service is not rolled back.
Programming notes
The event exit VORGANG must not use KDCS calls.
The longest processing time of the event exit VORGANG should be less than the maximum time in seconds for which a resource locked by another process is to be waited (KDCDEF statement MAX, RESWAIT operand, value time2) since UTM locked resources during the event exit VORGANG at the end of the service.
You can exit the event exit VORGANG with a return statement.
You can access the KB header and SPAB but the KB program area and the SPAB do not contain any relevant data.
openUTM enters the service indicator for this exit program in the KCKNZVG/kccv_status field of the KB header. The service indicator can assume one of the following values:
F
First program unit run of a dialog service
C
First program unit run of a concatenated service
A
Restart of a service
R
Errored end of service
Z
End of service
E
End of service
D
Termination of the service due to connection cleardown or loss of connection if RESTART=NO is generated for the UTM user id.
The program indicator (field KCPRIND) shows whether a exit program is running in a dialog service or in an asynchronous service:
A
The program unit is running in an asynchronous service.
D
The program unit is running in a dialog service.
Note that in distributed transaction processing, after the end of the service, the VORGANG event exit may be processed by a process other than the one which processed the last program unit in the service.
Generation notes
There can be more than one event exit VORGANG for a single application.
Which event exit VORGANG is called for which service is defined with the TAC statement, operand EXIT=TAC of the service. In particular, the event-driven services BADTACS, MSGTAC and SIGNON can have an event exit VORGANG.
Each event exit VORGANG requires a PROGRAM statement.