× 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 6/24/2013 6:11 PM, Jerry C. Adams wrote:
Just for the record, I've always included the EXTPGM on the PR simply because I use copybooks to retrieve them (per Mr. Tuohy).

My question, though, since the latest release on which I have worked is V5R4, is "Why would you want/need EXTPGM on the PI?" [If this question was asked/answered previously, I apologize, but I didn't see or understand it.]


You need EXTPGM on the prototype if you're _ever_ going to call the program from RPG. In that case, the prototype goes in a /copy file and gets copied into the program source itself, and into all the source that calls it.

So you're doing it right, by putting the prototypes in a /copy file with EXTPGM.

7.1: If you're _never_ going to use the prototype to call the program from RPG, then don't bother coding the prototype at all. Just code the PI without a name and without EXTPGM.

<= 6.1: If you're _never_ going to call the program from RPG, put the prototype in the program source, and you don't need the EXTPGM. But remember that if you don't code EXTPGM, the prototype name has to match the module. Without EXTPGM, you're technically coding a prototype for the main procedure, not for the program.

Examples of programs that will never be called by RPG:
- command processing programs
- exit point programs
- throwaway hacks for casual testing
- (possibly) programs only intended to be called by CL


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.