TDNUMPRM

Description

Determines how many parameters were sent with the current RPC by the remote client or server.

Syntax

%INCLUDE SYGWPLI;
01 TDPROC          PTR,
01 NUMBER_OF_PARMS FIXED BIN(31);
CALL TDNUMPRM (TDPROC, NUMBER_OF_PARMS); 

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.

NUMBER_OF_PARMS

(O) Number of parameters accepted as part of the current RPC. This argument replaces the RETCODE argument for this function and is where the result of function execution is stored.

Returns

This function returns the number of parameters in the NUMBER_OF_PARMS argument.

Examples

Example 1

The following code fragment illustrates a typical use of TDNUMPRM. This example is taken from the sample program in Appendix B, “Sample RPC Application for CICS.”

	 /*      ------------------------------------------------------------*/
	 /*      accept client request                                       */
	 /*      ------------------------------------------------------------*/
          CALL TDACCEPT (GWL_PROC, GWL_RC, GWL_INIT_HANDLE,
                         SNA_CONNECTION_NAME,
                         SNA_SUBC);
 
  /*      ------------------------------------------------------------*/
  /*      TDRESULT to validate kicked off via rpc request             */
  /*      ------------------------------------------------------------*/
          CALL TDRESULT (GWL_PROC, GWL_RC);
          IF GWL_RC ^= TDS_PARM_PRESENT THEN
          DO;
              CALL TDRESULT_ERROR;
              GO TO END_PROGRAM;
          END;
  /*------------------------------------------------------------------*/
  GET_NR_OF_PARMS:
  /*------------------------------------------------------------------*/
  /*      ------------------------------------------------------------*/
  /*      get nr of parms .. better be two                            */
  /*      ------------------------------------------------------------*/
          CALL TDNUMPRM (GWL_PROC, GWL_NUMPRM_PARMS);
 
          IF GWL_NUMPRM_PARMS ^= 2 THEN
          DO;
              CALL TDNUMPRM_ERROR;
              GO TO END_PROGRAM;
          END;
  /*------------------------------------------------------------------*/
  GET_PARMS:
  /*------------------------------------------------------------------*/

Usage


TDNUMPRM

A server application uses this function to determine how many parameters were sent with a client RPC.

See also

Related functions