Hi David,
When a cycle-main procedure is called through a bound call, I thought
that meant using the CALLP, and that a prototype would then have to
be defined for the call.
Yes, that is correct. CALLP means "call with prototype", and a prototype
must always be defined to use CALLP.
Prototypes can be used to make *any* type of call. This includes
dynamic calls (aka "program calls") when the ExtPgm keyword is used, JNI
calls (aka "java method calls") when Extproc(*JAVA) is specified, or
bound calls (aka "procedure calls") when ExtProc() is specified without
*JAVA. When no ExtProc/ExtPgm keyword is given, a bound call is done by
default.
CALLP with EXTPGM replaces the old (deprecated) CALL/PARM.
CALLP without any keywords, or with ExtProc, replaces the old
(deprecated) CALLB/PARM.
In this case, what actually gets bound to
the caller when the module containing the CALLP is compiled?
Nothing is ever bound when you compile a module. Binding is a separate
step that's done after compiling the module. (aka CRTPGM or CRTSRVPGM)
If you mean "what gets bound when I create a program/srvpgm containing
the CALLP" the answer is "the modules and service programs you told it
co bind". Or if it's using a binding directory, the answer is "the
first module that has a procedure name that matches what the one you
tried to call".
None of this is really related to cycle-main vs. main vs. subprocedure
calls... binding/calling works exactly the same for the 3 types of
procedures. The only difference between them is what code gets executed
when you call them...
This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.