Frees up all MVS storage.
COPY SYGWCOB.
01 IHANDLE PIC S9(9) USAGE COMP SYNC. 01 RETCODE PIC S9(9) USAGE COMP SYNC.
CALL 'TDTERM' USING IHANDLE, RETCODE.
(I) Pointer to 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 listed in Table 3-44.
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 in a Gateway-Library transaction using the IMS TM implicit API. The transaction processes multiple client requests, using TDGETREQ to call each request after the first. This example is taken from the sample program in Appendix D, “Sample RPC Application for IMS TM (Implicit).”
*---------------------------------------------------------------- SEND-ROWS. *----------------------------------------------------------------
PERFORM FETCH-AND-SEND-ROWS UNTIL ALL-DONE.
FINISH-REPLY. CALL ‘TDSNDDON’ USING GWL-PROC, GWL-RC, WRK-DONE-STATUS, CTR-ROWS, TDS-ZERO, TDS-ENDRPC. . [check return code] .
* Get next client request
MOVE TDS-TRUE TO GWL-WAIT-OPTION. MOVE ZEROES TO GWL-REQ-TYPE. MOVE SPACES TO GWL-RPC-NAME. CALL ‘TDGETREQ’ USING GWL-PROC, GWL-RC, GWL-WAIT-OPTION, GWL-REQ-TYPE, GWL-RPC-NAME.
EVALUATE GWL-RC WHEN ZEROES GO TO READ-IN-USER-PARM WHEN TDS-RESULTS-COMPLETE PERFORM FREE-ALL-STORAGE WHEN TDS-CONNECTION-TERMINATED PERFORM FREE-ALL-STORAGE WHEN OTHER MOVE ‘TDGETREQ’ TO CALL-ERROR PERFORM DISPLAY-CALL-ERROR END-EVALUATE. GOBACK.
*--------------------------------------------------------------- FREE-ALL-STORAGE. *--------------------------------------------------------------- CALL ‘TDFREE’ USING GWL-PROC, GWL-RC. . [check return code] CALL ‘TDTERM’ USING GWL-INIT-HANDLE, GWL-RC.
TDTERM 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.
For more information, refer to your IMS TM product documentation.
Related functions
Related topics
Related documents
Mainframe Connect Client Option and Server Option Messages and Codes
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |