PARMS
The PARMS function returns the number of parameters that were passed to the program or procedure in which the PARMS function is used. When the PARMS function is used in a procedure that was called by a bound call, the value that is returned by the PARMS function is not available if the calling program or procedure does not pass a minimal operational descriptor. The ILE COBOL compiler always passes at least a minimal operational descriptor when the program is compiled for target release V7R3M0 or greater. ILE RPG and ILE CL programs also pass at least a minimal operational descriptor. ILE C and C++ require the "descriptor" pragma to cause an operational descriptor to be passed. Other interfaces might not have any way of passing an operational descriptor. If the operational descriptor is not passed, the value that is returned by the PARMS function is unpredictable.
The value that is returned by PARMS is -1 if the system determines that the operational descriptor was not passed, but in some cases when the system cannot detect this situation, the value that is returned by PARMS might be an incorrect value that is zero or greater.
The function type is integer.
For example, if the calling program has the following two CALL statements
CALL PGM1 USING A B C.
CALL PGM1 USING A B C RETURNING D.
MOVE FUNCTION PARMS TO RECEIVED-PARMS
then the value of RECEIVED-PARMS is 3 for both calls.

