IBM AS/400 Frozen Dessert Maker User Manual


 
Using the Fixed-Form Call Operations
If insufficient parameters are specified when calling a procedure, an error occurs
when an unresolved parameter is used by the called procedure. To avoid the error,
you can either:
Check %PARMS to determine the number of parameters passed. For an
example using %PARMS, see “Checking for the Number of Passed
Parameters” on page 141.
Specify *OMIT in the result field of the PARM operations of the unpassed
parameters. The called procedure can then check to see if the parameter has
been omitted by checking to see if the parameter has value of *NULL, using
%ADDR(parameter) = *NULL. For more information, refer to “Omitting
Parameters” on page 139.
Keep in mind the following when specifying a PARM operation:
One or more PARM operations must immediately follow a PLIST operation.
One or more PARM operations can immediately follow a CALL or CALLB oper-
ation.
When a multiple occurrence data structure is specified in the Result field of a
PARM operation, all occurrences of the data structure are passed as a single
field.
Factor 1 and the Result field of a PARM operation cannot contain a literal, a
look-ahead field, a named constant, or a user-date reserved word.
The following rules apply to *OMIT for non-prototyped parameters:
*OMIT is only allowed in PARM operations that immediately follows a
CALLB operation or in a PLIST used with a CALLB.
Factor 1 and Factor 2 of a PARM operation must be blank, if *OMIT is
specified.
*OMIT is not allowed in a PARM operation that is part of a *ENTRY PLIST.
There are other restrictions that apply when using the PARM operation code.
For a detailed description of these restrictions, see the
ILE RPG for AS/400
Reference
.
For examples of the PARM operation see:
Figure 47 on page 105
Figure 42 on page 95
Figure 116 on page 239
Using the PLIST Operation
The PLIST operation:
Defines a name by which a list of parameters can be referenced. The list of
parameters is specified by PARM operations immediately following the PLIST
operation.
Defines the entry parameter list (*ENTRY PLIST).
Factor 1 of the PLIST operation must contain the PLIST name. This name can be
specified in the Result field of one or more call operations. If the parameter list is
the entry parameter list of a called procedure, then Factor 1 must contain *ENTRY.
Chapter 10. Calling Programs and Procedures 151