%PARMS Built-In Functions in rpgle
%PARMS returns the number of parameters that were passed to the procedure in which %PARMS is used. For the main procedure, %PARMS is the same as *PARMS.
Example I –%parms built-in function in rpgle
%PARMS in CALL BY VALUE
Columns . . . : 6 80 Browse AMITCC/QRPGLESRC
SEU==> PARM_PGM
FMT D DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ************************************************
0001.00 DCALL1 PR
0002.00 DPARM1 2 0 VALUE
0003.00 DPARM2 2 0 VALUE
0004.00 DPARM_COUNT S 2 0 INZ(*ZEROS)
0005.00 C CALLP CALL1(11:22)
0006.00 C SETON LR
0007.00 PCALL1 B
0008.00 DCALL1 PI
0009.00 DPARM11 2 0 VALUE
0010.00 DPARM22 2 0 VALUE
0011.00 C EVAL PARM_COUNT=%PARMS + PARM22+ PARM11
0012.00 C PARM_COUNT DSPLY
0013.00 PCALL1 E
****************** End of data ***************************************************
OUTPUT
Example II –%parms built-in function in rpgle
%PARMS in CALL BY VALUE
Columns . . . : 6 80 Browse AMITCC/QRPGLESRC
SEU==> PARM_PGM2
FMT D DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ************************************************
0001.00 DCALL1 PR
0002.00 DPARM1 2 0
0003.00 DPARM2 2 0
0004.00 DPARM_COUNT S 2 0 INZ(*ZEROS)
0005.00 DP1 S 2 0 INZ(11)
0006.00 DP2 S 2 0 INZ(22)
0007.00
0008.00 C CALLP CALL1(P1:P2)
0009.00 C SETON LR
0010.00 PCALL1 B
0011.00 DCALL1 PI
0012.00 DPARM01 2 0
0013.00 DPARM02 2 0
0014.00 C EVAL PARM_COUNT=%PARMS + PARM02+ PARM01
0015.00 C PARM_COUNT DSPLY
0016.00 PCALL1 E
****************** End of data **************************************************
OUTPUT