Deallocates a context structure.
%INCLUDE CTPUBLIC; DCL 01 CONTEXT FIXED BIN(31) INIT(0); 01 RETCODE FIXED BIN(31) INIT(0); CALL CSBCTXDR (CONTEXT, RETCODE);
(I) A context structure.
(O) Variable where the result of function execution is returned. Its value is one of the codes listed under “Returns,” in this section.
CSBCTXDROP returns one of the following values:
Value |
Meaning |
---|---|
CS_SUCCEED (-1) |
The routine completed successfully. |
CS_FAIL (-2) |
The routine failed. The most common cause for a CSBCTXDROP failure is that the context contains an open connection. |
The following code fragment demonstrates how CSBCTXDROP is used with other functions at the end of a program to close the connection and return to CICS. It is taken from the sample program SYCTSAA4 in Appendix A, “Sample Language Application.”
/*------------------------------------------------------------------*/ /* */ /* Subroutine to perform exit client library and deallocate context */ /* structure. */ /* */ /*------------------------------------------------------------------*/ QUIT_CLIENT_LIBRARY: PROC ; /*------------------------------------------------------------------*/ /* exit the Client Library */ /*------------------------------------------------------------------*/ CALL CTBEXIT( CSL_CTX_HANDLE, CSL_RC, CS_UNUSED ) ; IF CSL_RC = CS_FAIL THEN DO ; MSGSTR = 'CTBEXIT failed' ; CALL ERROR_OUT ; END ; /*------------------------------------------------------------------*/ /* de-allocate the context structure */ /*------------------------------------------------------------------*/ CALL CSBCTXDR( CSL_CTX_HANDLE, CSL_RC ) ; IF CSL_RC = CS_FAIL THEN DO ; MSGSTR = 'CSBCTXDROP failed' ; CALL ERROR_OUT ; END ; EXEC CICS RETURN ; END QUIT_CLIENT_LIBRARY ;
CSBCTXDROP deallocates a context structure.
A context structure describes a particular context, or operating environment, for a set of server connections.
Once a context has been deallocated, it cannot be reused. To allocate a new context, an application calls CSBCTXALLOC.
A Client-Library application cannot call CSBCTXDROP to deallocate a context structure until it has called CTBEXIT to clean up Client-Library space associated with the context.
CSBCTXDROP fails if the context contains an open connection.
Related functions: