Determines how many parameters were sent with the current RPC by the remote client or server.
%INCLUDE SYGWPLI;
01 TDPROC PTR, 01 NUMBER_OF_PARMS FIXED BIN(31);
CALL TDNUMPRM (TDPROC, NUMBER_OF_PARMS);
(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) 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.
This function returns the number of parameters in the NUMBER_OF_PARMS argument.
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: /*------------------------------------------------------------------*/
A server application uses this function to determine how many parameters were sent with a client RPC.
When a cursor command is received, this function returns the number of cursor parameters for the current cursor.
Use this function to determine how many parameters you need to retrieve with TDRCVPRM. You must call TDRCVPRM once for each parameter.
Related functions
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |