Passing Arguments to ILE Procedures
In an ILE procedure call, an argument is
an expression that represents a value that the calling procedure passes
to the procedure specified in the call. ILE languages use three methods
for passing arguments:
- by value, directly
- The value of the data object is placed directly into the argument list.
- by value, indirectly
- The value of the data object is copied to a temporary location. The address of the copy (a pointer) is placed into the argument list.
- by reference
- A pointer to the data object is placed into the argument list. Changes made by the called procedure to the argument are reflected in the calling procedure.
Figure 1 illustrates these argument passing styles. Not all ILE languages support passing by value, directly. The available passing styles are described in the ILE HLL programmer's guides.

HLL semantics usually determine when data is passed by value and when it is passed by reference. For example, ILE C passes and accepts arguments by value, directly, while for ILE COBOL and ILE RPG, arguments are usually passed by reference. You must ensure that the calling program or procedure passes arguments in the manner expected by the called procedure. The ILE HLL programmer's guides contain more information on passing arguments to different languages.
A maximum of 400 arguments are allowed on a static procedure call.
Each ILE language may further restrict the maximum number of arguments.
The ILE languages support the following argument-passing styles:
- ILE C passes and accepts arguments by value directly, widening integers and floating-point values by default. Arguments can be passed unwidened or by value indirectly if you specify the appropriate values on the #pragma argument directive for the called function.
- ILE C++ passes and accepts arguments by value directly. C++ does not widen parameters and floating-point values by default. Arguments can be widened or passed by value indirectly if you specify the appropriate values on the extern linkage specifier for the declaration of the called function.
- ILE COBOL passes and accepts arguments by value, by reference, or by value indirectly. Parameters that are passed by value are not widened.
- ILE RPG passes and accepts arguments by value, or by reference. RPG does not widen integers and floating point values by default, but this is available for parameters passed by value, by coding EXTPROC(*CWIDEN).
- ILE CL passes and accepts arguments by reference and by value. Parameters that are passed by value are not widened.