× 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 28/09/2009, at 8:36 PM, David FOXWELL wrote:

As someone still new to service programs, I'm having a problem understanding how to use binder source. Is the idea to be able to make several service programs with different procedures from the same modules?

No. Binder source defines the public interface for the service program. Binding directories CAN be used to include the same module in multiple programs or service programs (but then so can the MODULE keyword). Usually a bad idea to include the same module in multiple objects.

Here's the reason for my question :

We have an early RPGIV containing one function that was written for use by an OPM. Subsequently other RPGIV have started calling this program. Each programmer wrote his own internal prototype to call the RPGIV function.
I've been made to transfer the code of this function to another module containing the rest of the procedures for that particular application. The existing program has therefore become an encapsulating program only.

I compared the size of the new and old objects :

OLD LIBRARY
MYPGM *PGM 843776
MYMOD *MODULE 819200

NEW LIBRARY
MYPGM *PGM 60141568
MYMOD *MODULE 2818048

This is a 7100% increase in size for the program!

This is understandable, because everything is bound uniquely by copy, and the module that now contains the function makes many other external calls.

Now, If we used a service program, I'm assuming that it would be compiled by copy uniquely on MYMOD, and the other modules used would be bound by reference to other service programmes, thus considerably reducing the size of the service program. Is that right?

Essentially correct. The service program would bind-by-copy to MYMOD plus any other modules you either list on the MODULE keyword or that you include in a referenced binding directory. It would bind-by- reference to any service programs you list on the BNDSRVPGM keyword or that you include in a referenced binding directory. Note that modules listed on the MODULE keyword are bound whether you reference any exports within them or not. Modules listed in a binding directory are bound only if they satisfy an unresolved reference.

How would binder source help?

It wouldn't.

In this example, we may have 20 users using applications that call MYPGM. So that means that when we install, we can expect to use 20 * 60141568 in memory instead of 20 * 843776 bytes. Would that be correct?

No. Program code is demand paged so only a small proportion of the program code will be in main storage at any one time. Program code is shared between users. All static variables will require separate storage in each job.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




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.