Returns information about the current client request.
%INCLUDE SYGWPLI;
01 TDPROC PTR, 01 RETCODE FIXED BIN(31), 01 REQUEST_TYPE FIXED BIN(31), 01 RPC_NAME CHAR(n), 01 COMM_STATE FIXED BIN(31);
CALL TDINFRPC (TDPROC, RETCODE, REQUEST_TYPE, RPC_NAME, COMM_STATE);
(I) Handle for this client/server connection. This must be the same value specified in the associated TDACCEPT call. The TDPROC handle corresponds to the connection and command handles 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-19.
(O) Type of request to be accepted. Returns one of the following values:
TDS_LANGUAGE_EVENT (1) |
Current request is a language request. |
TDS_RPC_EVENT (3) |
Current request is an RPC. |
TDS_DYNAMIC_EVENT (4) |
Current request is a dynamic SQL request. |
TDS_CURSOR_EVENT (5) |
Current request is a cursor request. |
TDINFPGM and TDGETREQ also return this information.
These are new values. The old values (TDS_START_SQL
and TDS_START_RPC) still work, but you should
use the new values from now on.
(O) Variable where the name of the current client RPC is returned. If the client request is not an RPC, this field contains blanks.
(O) Variable where the current communication state of the mainframe transaction is stored. COMM_STATE is one of the following values:
TDS_RESET (0) |
Client/server conversation for this transaction ended. If the current transaction is running under CICS or uses the IMS TM explicit API, the transaction should exit as soon as possible. If the current transaction is a WFI transaction using the IMS TM implicit API, the transaction can accept another client request by calling TDGETREQ. |
TDS_SEND (1) |
Transaction is in SEND state. |
TDS_RECEIVE (2) |
Transaction is in RECEIVE state. |
TDSTATUS also returns this information.
See “Communication states” for an explanation of SEND and RECEIVE states.
The RETCODE argument can contain any of the return values listed in Table 3-19.
Return value |
Meaning |
---|---|
TDS_OK (0) |
Function completed successfully. |
TDS_CONNECTION_TERMINATED (-4997) |
Connection closed. The remote partner closed (deallocated) the client/server connection. |
Use TDINFRPC in long-running transactions to determine:
The type of client request currently being processed
The name of the current client request, if the request is an RPC
Whether the transaction is in the correct communication state for retrieving the next request (issuing TDGETREQ)
Long-running transactions use TDGETREQ to retrieve each request that follows the first request. TDGETREQ returns the request type and transaction name for each client request it accepts.
An application program can call TDINFRPC at any point in the program to retrieve information about the RPC or communication state.
The Gateway-Library function, TDSTATUS, also returns the communication state in addition to TDS status information and standard communication error codes. Call TDSTATUS when all incoming parameters are retrieved or after all results are sent. Call TDINFRPC to learn the current communication state at all other times.
To change the communication state:
From RECEIVE state to SEND state, call TDRESULT. This shifts the transaction into SEND state and cancels the current request.
From SEND state to RECEIVE state, call TDSNDDON. This indicates that all results are sent and processing for the current request ended.
TDINFRPC is not a required call.
When using the IMS TM implicit API:
If COMM_STATE is TDS_RESET and this is a WFI transaction, the transaction can either end or call TDGETREQ to accept another client request.
When using the IMS TM explicit API:
If COMM_STATE is TDS_RESET, the transaction should exit as soon as possible.
See “Long-running transactions” for information about coding long-running transactions under IMS TM.
Related functions
Related topics