× 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 Tue, Nov 1, 2022 at 11:03 AM Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>
wrote:

Why to bind multiple modules in a single service program?


Biggest reason IMHO is that it allows you to have procedures (or variables)
exported from the module but not the service program.

These can be used by other modules inside the service program, but not
anything outside the service program.
As Barbara Morris puts it:
There are 5 levels of privacy available to an ILE programmer.

• Local to a procedure: the file or variable can only be used within the
procedure
• Global in the module: the procedure, file, or variable can be used by any
procedure in the module
• Exported from the module: the variable or procedure can be used by any
other module in the same program or service program that imports the
variable or calls the procedure
• Exported from the service program: the variable or procedure can be used
by anything that binds to the service program and imports the variable or
calls the procedure
• Public: anyone or any program can call a program.

In addition, I think there's some maintainability benefits when you've got
tightly related procedures group into their own modules rather than just
all generally related procedures in one module.
Related to this, I found it considerably easier (and safer) to migrate
SR/PI code blocks from *PGM object to a *SRVPGM procedure if I could stick
them in a new module rather than trying to put them into an existing module.

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.