TDTERM

Description

Frees up all MVS storage.

Syntax

% INCLUDE SYGWPLI;
01 IHANDLE PTR,
01 RETCODE FIXED BIN(31);
CALL TDTERM (IHANDLE, RETCODE);

Parameters

IHANDLE

(I) A transaction-wide structure that contains information used to set up the Gateway-Library environment. This must be the same IHANDLE specified in the program’s initial TDINIT call. It corresponds to the context structure in Open Client Client-Library.

RETCODE

(O) Variable where the result of function execution is returned. Its value is one of the codes listed in Table 3-44.

Returns

The RETCODE argument can contain any of the return values in the following table.

Table 3-44: TDTERM return values

Return value

Meaning

TDS_OK (0)

Function completed successfully.

TDS_INVALID_IHANDLE (-19)

Invalid IHANDLE specification. Error in specifying a value for the IHANDLE argument.

TDS_INVALID_PARAMETER (-4)

Invalid parameter value. The value assigned to one or more of the arguments supplied in the call is not valid. The operation failed.

Examples

Example 1

The following code fragment illustrates the use of TDFREE and TDTERM at the end of a Gateway-Library program. This example is taken from the sample program SYIXSAM1, listed in Appendix E, “Sample RPC Application for IMS TM (Implicit).”

 FREE_STORAGE: PROC;                                                   
                                                                        
          CALL TDFREE (GWL_PROC, GWL_RC);                               
                                                                        
          IF GWL_RC ^= 0 THEN                                           
             DO;                                                        
                CALL_NAME = ‘TDFREE  ‘;                                 
                CALL_MSG = ‘ERROR IN CALL RC=’;                         
                CALL_RC  = GWL_RC;                                      
                PUT FILE(SYSPRINT) DATA(ERROR_MSG);                     
             END;                                                       
                                                                        
          CALL TDTERM (GWL_INIT_HANDLE, GWL_RC);                        
                                                                        
          IF GWL_RC ^= 0 THEN                                           
             DO;                                                        
                CALL_NAME = ‘TDTERM  ‘;                                 
                CALL_MSG = ‘ERROR IN CALL RC=’;                         
                CALL_RC  = GWL_RC;                                      
                PUT FILE(SYSPRINT) DATA(ERROR_MSG);                     
             END;                                                       
                                                                        
  END FREE_STORAGE;                                                     

Usage


TDTERM

This function frees all TDPROCs and underlying free control blocks, including the IHANDLE, in preparation for program termination. It also deallocates the connection, if it is still active, and frees its queues.

See also

Related functions

Related topics

Related documentation