TDINFRPC

Description

Returns information about the current client request.

Syntax

%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); 

Parameters

TDPROC

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

RETCODE

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

REQUEST_TYPE

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

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

RPC_NAME

(O) Variable where the name of the current client RPC is returned. If the client request is not an RPC, this field contains blanks.

COMM_STATE

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

Returns

The RETCODE argument can contain any of the return values listed in Table 3-19.

Table 3-19: TDINFRPC return values

Return value

Meaning

TDS_OK (0)

Function completed successfully.

TDS_CONNECTION_TERMINATED (-4997)

Connection closed. The remote partner closed (deallocated) the client/server connection.

Usage


TDINFSPT

Use TDINFRPC in long-running transactions to determine:

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.


For IMS TM users

When using the IMS TM implicit API:

When using the IMS TM explicit API:

See also

Related functions

Related topics