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



Charles

Good points - this conversation can only be helpful, I hope. I assume you know this stuff, and I'm providing this for my edification and for the archives.

I'm looking now at the ILE Concepts book - in a description of OPM, it uses the term "dynamic binding" for the call mechanism.

Later is a statement that "The function of the binder is similar to, but somewhat different from, the function provided by a linkage editor." Now things begin to get a little iteresting for me. It speaks of binding by copy or by reference. OK, modules, whether on the MODULE parameter or form a BNDDIR, are copied into the program object and physical addresses are resolved at creation - what I called early binding.

Binding by reference puts symbolic links into the object, which are resolved to physical addresses at activation.

Later it says that program activation completes the binding of programs to service programs. What I called late binding. I've not found that exact phrase yet.

In the terms of Fortress Rochester, it seems that, once resolved, calls to service program procedures is a static call - ILE Concepts does say there is little difference.

There is this paragraph, which explains this call stuff pretty nicely -

"Once a service program is activated static procedure calls and static data item references to a module within a different service program are processed. The amount of processing is the same as would be required if the modules had been bound by copy into the same program. However, modules bound by copy require less activation time processing than service programs."

Maybe this is enough - I guess I've thought of the linker as the thing that assembles the modules into the final program or service program. Maybe that's what the binder does - maybe they are the same thing but just different!

The idea of linkage relates for me to taking .o files and combining them into .exe in C/C++ on a DOS or Windows box.

Also, static procedure calls seem to have an early and a late variety - calls to procedures in modules vs. calls to procedures in service programs. My use of early and late refers to this context, I think.

Whew! I really like trying to clarify these things - we have 1 or 2 developers who ask me about this stuff - I needed this!

Thanks
Vern

On 8/29/2011 7:45 AM, Charles Wilt wrote:
Vern,

I think perhaps the terminology is easy too confuse...

According to Fortress Rochester (p. 140)
Static procedure calls = "early binding"
Dynamic program calls = "late binding"

The resolution of an ILE procedure reference at program activation is
not considered "binding".

In any event, I did not mean to imply that the binding directory was
needed at other than compile time.

Charles

On Sun, Aug 28, 2011 at 9:07 AM, Vern Hamberg<vhamberg@xxxxxxxxxxx> wrote:
Charles, I'm a little confused with your statement - "only used for
during the binding phase" - as you said, perhaps implicitly, there are 2
binding phases - one at program creation (early) and one at program
initiation (late).

The binding directory is not used for late binding - we never distribute
a binding directory with our products, for example, unless customers
will use one of our service programs for their development - that's the
same as IBM's QC2LE, for example. The binding directory is used for
creating a program - so that the linker can find where the various
references are located or will be located at run-time.

Although it seems Birgitta has an ugly situation, I prefer to use *LIBL
in BNDDIR entries - then I don't need to make a copy and change the
library when I bring an object into my development sandbox.

So far this has made sense for me - hope I'm not completely nuts, of
course - maybe a little but not completely!

Later
Vern

On 8/26/2011 1:23 PM, Charles Wilt wrote:
You're correct that a binding directory is only used for during the
binding phase...

The only benefit for them is so that you don't have to specify
individual modules on the MODULES parm or individual service programs
on the BNDSRVPGM parm of CRTPGM or CRTSRVPGM.

Charles

On Fri, Aug 26, 2011 at 2:00 PM, Steve Richter<stephenrichter@xxxxxxxxx> wrote:
Hi Birgitta,

when you DSPPGM, on the *SRVPGM tab, there is both srvpgm name and
library. So yes, a PGM can bind to a qualified SRVPGM or a SRVPGM
found on the *LIBL.

some minor terminology. You compile a module. Then create a program
from those modules.

I find binding directories of little value add. I don't use them. Not
knowing much about the mechanics of them, I don't think a binding
directory comes into play after the program is created. When a program
is called and activated, it binds to the SRVPGMs listed in the
DSPPGM/SRVPGM tab.

-Steve
.

On Fri, Aug 26, 2011 at 1:15 PM, Birgitta Hauser<Hauser@xxxxxxxxxxxxxxx> wrote:
Hi,

someone can explain the following situation.

I had to compile a CGI Program that calls procedures from a service program.
This service program is located in a different library.
The service program is also located in a binding directory that is used for
compiling the CGI program (H-Specs)

Until now everything worked great.

Yesterday the program was compiled (without problems), but as soon as it get
called from an web application I got an "Internal Serve Error".
After searching through all available logs, I found out an MCH3401 (Service
Program could not be found) was sent.
The program was recompiled last time around a week ago. A modification in a
procedure in the service program was made after.
So I also recreated the service program, recreated my program ... and still
got the same error.

The program could be called from a command line without problems, that means
the service program was found.

After a long search I found out the service program within the binding
directory was not specified with Library *LIBL.
I changed it to the library in which the service program is located.
... recreated everything ... and everything worked great.

... Is the library information stored somewhere in the caller
(service-)program so it is found and activated directly??????

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.