CTBCANCEL

Description

Cancels a request or the results of a request.

Syntax

%INCLUDE CTPUBLIC;
DCL
     01 CONNECTION        FIXED BIN(31) INIT(0);
     01 RETCODE              FIXED BIN(31) INIT(0);
     01 COMMAND            FIXED BIN(31) INIT(0);
     01 CANCELTYPE        FIXED BIN(31);
 
CALL CTBCANCE (CONNECTION, RETCODE, COMMAND, CANCELTYPE); 

Parameters

CONNECTION

(I) Handle for this connection. This connection handle must already be allocated with CTBCONALLOC. The connection handle corresponds to the TDPROC handle in the Open ServerConnect Gateway-Library.

Either CONNECTION or COMMAND must be null (zeroes). If CONNECTION is supplied and COMMAND is empty, the cancel operation applies to all commands pending for this connection.

RETCODE

(O) Variable where the result from an executed function returns. Its value is one of the codes listed under “Returns,” in this section.

COMMAND

(I) Handle for this client/server operation. This handle is defined in the associated CTBCMDALLOC call. The command handle also corresponds to the TDPROC handle in the Open ServerConnect Gateway-Library.

Either CONNECTION or COMMAND must be zeroes. If COMMAND is supplied and CONNECTION is zeroes, the cancel operation applies only to the command pending for this command structure.

CANCELTYPE

(I) Type of cancel requested. The following table lists the symbolic values that are legal for CANCELTYPE:

Value

Meaning

CS_CANCEL_ALL (6001) or CS_CANCEL_ATTN (6002)

CTBCANCEL sends an attention to the server, instructing it to cancel the current request, and immediately discards all results generated by the request.

Returns

CTBCANCEL returns one of the following values:

Value

Meaning

CS_SUCCEED (-1)

The routine completed successfully.

CS_FAIL (-2)

The routine failed.

TDS_CONNECTION_TERMINATED (-4997)

The connection is not active.

TDS_INVALID_TDPROC (-18)

Specified command handle is invalid.

TDS_WRONG_STATE (-6)

Program is in the wrong communication state to issue this call.

Usage


Canceling a request

See also

Related functions: