Assume a session has been created and a request started as in the single buffering, no rewind example given above. If the application wants to abort the request, the following must be performed.
The application sets the function code to abort (DBFABT) in the DBCAREA and calls DBCHCL.
DBCHCL allocates a request buffer and places an Abort parcel in the message body part of the Request Buffer. DBCHCL places the session and Request Ids in the MTDPCB, sets the function code to MTDPABOT, and calls MTDP.
MTDP prepares and sends an Abort Request message to the database, and waits for the Abort Response message. MTDP then returns control to DBCHCL.
If the return code in the MTDP Control Block is not normal, DBCHCL returns the error message pointed to by the DBCAREA to the application. Otherwise, the buffers allocated to the request are returned to free memory and the RCB is removed from its RCB list and returned to free memory.
If the return code or error flag in the DBCAREA is not normal, the application program makes the appropriate changes and then re-submits the DBCAREA to DBCHCL.