Previous Topic: &PANELID

Next Topic: &RETCODE


&PARMCNT

Supplies the count of the number of argument variables created when a procedure was invoked.

&PARMCNT is the count of the number of argument variables created on the statement when a procedure is invoked.

When a procedure is invoked, arguments is passed to the procedure by following the name of the procedure with the data to be passed.

The arguments is parsed into words and assigned into the user variables &1, &2, to & n, and &PARMCNT is set to the count of the variables created.

Example: &PARMCNT

&IF &PARMCNT EQ 0 &THEN +
  &WRITE DATA=REQUIRED DATA OMITTED

User enters:

EXEC PROC5 NCP1 NCP4

Notes:

&PARMCNT is set to 2, representing the entry of the variable values NCP1 and NCP4 (assigned to &1 and &2).

&PARMCNT is set only when a procedure is invoked and remains set to that initial value for the duration of processing. Subsequent functions do not change the value.

&PARMCNT applies only to the current nesting level. Each new nesting level establishes its own unique &PARMCNT value.

The &ALLPARMS variable provides a single variable that is a consolidation of all variables supplied on entry to the procedure.

More information:

&ALLPARMS

&CONTROL