× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Wed, Apr 22, 2009 at 6:04 AM, David FOXWELL <David.FOXWELL@xxxxxxxxx> wrote:
Hi Scott,

-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Scott Klement
Envoyé : mercredi 22 avril 2009 10:25

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".

Yes, that's what I meant to ask. I thought that binding the modules M1 and M2 meant some kind of copying of the code into the program object.
What I wanted to know was, if in M1 I have a CALLP to another program, then I think the code of that program is not duplicated in my calling program.


If you're using bind by copy, ie. a CRTPGM specifing MODULE(M1 M2),
the the code is indeed copied into your program.

However, if you've put the modules into a service program, ie.
CRTSRVPGM SRVPGM(SRVPGM1) MODULE(M1 M2) and you bind by reference to
the service program, ie a CRTPGM that specifies BNDSRVPGM(SRVPGM1),
then the code is not copied to your program. The code exists only in
the service program

In both cases, your program is making a bound call. You could use
CALLB but CALLP is preferred.



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.

I think the infocenter is saying I can't use CALLP if I've declared MAIN in the module of the procedure to be called. Does that mean I need to use the fixed form CALL operation and I can not use a prototype?


Incorrect. You can always use CALLP. When the program has linear
main procedure, you simply have to use EXTPGM just like you would with
a program that uses a cycle main procedure.


Charles

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.