Frees up all MVS storage.
% INCLUDE SYGWPLI;
01 IHANDLE PTR, 01 RETCODE FIXED BIN(31);
CALL TDTERM (IHANDLE, RETCODE);
(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.
(O) Variable where the result of function execution is returned. Its value is one of the codes listed in Table 3-44.
The RETCODE argument can contain any of the return values in the following table.
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. |
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;
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.
This function is required in MVS and IMS TM programs to free up MVS storage when the MVS or IMS TM application exits. In CICS programs, it is optional.
Related functions
Related topics
Related documentation
Mainframe Connect Server Option for IMS and MVS Installation and Administration Guide
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |