TDTERM

Description

Frees up all MVS storage.

Syntax

COPY SYGWCOB.
01 IHANDLE PIC S9(9)  USAGE COMP SYNC.
01 RETCODE PIC S9(9)  USAGE COMP SYNC.
CALL 'TDTERM' USING IHANDLE, RETCODE.

Parameters

IHANDLE

(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.

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 listed in Table 3-44.

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 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.

Usage

See also

Related functions

Related topics

Related documents