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



David FOXWELL wrote:
Module 1 Procedure 1 calls Module 2 Procedure 1.
Module 2 Procedure 2 calls Module 3 Procedure 1.

Module 3 Procedure 1 gets the following modification : a parameter M3P1Parm that is a DS declared LIKE another DS in the same module. Module 2 Procedure 2 is modified accordingly.
>
Module 3 is recompiled, no problem.
Module 2 is recompiled, the compiler imports the protoypes of all the exported procedures of Module 3 with the definition of M3P1Parm, again no problem.
Module 1 is recompiled, the compiler imports the protoypes of all the exported procedures of Module 2 : Procedure 1 that is uses, and Procedure 2 that it doesn't - PROBLEM, it doesn't know what is M3P1Parm.

Do you mean that Module 2 procedure 2 gets a new parameter that is also defined LIKEDS(M3P1Parm)? I assume that is what you mean by "Module 2 Procedure 2 is modified accordingly"

If yes, then I think that the definition of M3P1Parm should be in its own copy member, and /copied in the procedure prototype copy member for both modules 2 and 3. My rule of thumb is that procedure prototypes for exported procedures should only use LIKE definitions if those definitions are also in the copy member containing the prototype.


I suggest that Module 2 should be a service program and that Module 1 would not have to be recompiled.

This sounds like a dangerous proposition to me. What happens when you need to make a quick fix to some unrelated code in Module 1? The person doing maintenance will have to figure out why the prototypes from Module 2 are causing problems.


I am reminded that we do not use service programs as they use dynamic calls and that would mean the same as going back to RPGIII.

I'm relatively new to RPG, so I don't know what "like going back to RPGIII" means. That said, we haven't found the "bind by reference" operation of service programs to be a problem. On the contrary, it is really handy to be able to fix a bug in a service program procedure and not have to recompile all of the calling programs.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.