Description: Calls a bound procedure (module).
CALLB(D|E) (Call a Bound Procedure)
The CALLB opcode in RPG is used to call a bound procedure that’s statically linked to the main program. It’s a static call, meaning the procedure is bound at compile time. You can use the operation extender ‘D’ to include operational descriptors for parameters passed to the called procedure. If an error occurs during the call, you can trace it using the error indicator ‘E’ or the built-in functions %ERROR and %STATUS. CALLB offers faster execution than program calls since it’s already compiled and tested.
Legacy RPG400 Example:
C PARM Param1
Modern RPGLE Example:
The callb (CALL BOUND) is optional and assumed.
Very similar to how we define calls to external programs, and its parameters, using the declare statement. The first statement begins with DCL-PR, followed by the name of the prototype, followed by keywords, and finally a semicolon.
PARAM1 CHAR(10) CONST;
END-PR;
Now you can reference that procedure name and pass a value as the parameter. This example is calling the program and passing the value stored in a variable called "customer"
If you had a module compiled and called MODULEA and it contains 3 seperate procedures these could be referenced by any ILE program that has that module bound into it.
