CSBCTXDROP

Description

Deallocates a context structure.

Syntax

%INCLUDE CTPUBLIC;
 
 DCL
     01 CONTEXT        FIXED BIN(31) INIT(0);
     01 RETCODE        FIXED BIN(31) INIT(0);
 
 CALL CSBCTXDR (CONTEXT, RETCODE);

Parameters

CONTEXT

(I) A context structure.

RETCODE

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

Returns

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.

Examples

Example 1

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 ;

Usage

See also

Related functions: