Parameters are those variables passed to the procedure when it is invoked by the operator, by another procedure, or by your product.
Parameters entered when the procedure is invoked are positional and must be entered in the order expected by the procedure. Entered parameters are separated by one or more blanks. Commas are not accepted as delimiters between parameters. The procedure must verify that the entered parameters are correct. Each parameter is allocated to a variable in the form &n, where n is a number, starting at 1, identifying the position of the parameter.
If the operator enters:
EXEC TEST1 PU1 LU2 NCP3
the following variables are created:
&1 will be set to PU1 &2 will be set to LU2 &3 will be set to NCP3
In addition, when a procedure is invoked, the user variable &ALLPARMS will be set to the entire string provided, excluding the EXEC or START command and the procedure name. In the previous example, &ALLPARMS is set to:
PU1 LU2 NCP3
The system also supplies a count of the number of variables created in the system variable &PARMCNT. In the previous example, &PARMCNT is set to 3.
Note: &CONTROL SHRVARS can be utilized to pass some or all variables to a lower nesting level rather than specifying individual parameters.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |