Description: Calls a prototyped procedure or program.
Code | Factor 1 | Extended Factor 2 | ||||
|---|---|---|---|---|---|---|
CALLP (E M/R) | name{ (parm1 {:parm2…}) } | |||||
The CALLP operation in RPGLE is used to call prototyped procedures or programs. Here are some key points:
- Syntax: The CALLP operation uses a free-form syntax, allowing you to specify the name of the prototype and any parameters to be passed.
- Static Calls: It is a static call by default, but if the keyword EXTPGM is specified, it becomes a dynamic external call.
- Error Handling: If there is an error during the CALLP operation, you can trace it using the operator extender ‘E’ and LO level indicator.
- Prototyping: Prototypes must be defined in the module where the CALLP operation is used, either explicitly or implicitly.
- Example: For instance, you can call a procedure defined in another module using the CALLP operation.
Modern(ish) RPGLE Example:
Modern RPGLE Example:
The CALLP operation is used to call procedures or programs that have prototypes.
Unlike other call operations, CALLP uses a free-form syntax. You simply use the name operand to indicate the prototype of the program or procedure you’re calling, along with any parameters to pass, much like calling a built-in function. You can pass up to 255 parameters for a program call and up to 399 for a procedure call.
| Free-Form Syntax | {CALLP{(EMR)}} name( {parm1{:parm2...}} ) |
