Midware Ltd.

Static Binding


Sign-up for e-mail notifications

Take our weekly poll

Dow Jones Intraday

Nasdaq Intraday



In the previous example, we used to CRTPGM command to bind two modules into a single executable program.  This type of binding is called static.  The program contains a fully copy of both of the modules.  The modules can (and unless they will be used to create other programs, probably should) safely be deleted.  The program can be distributed to other AS/400's without the modules and it will run normally.

There are pros and cons to static binding.  The main advantage is that the compiled program has already resolved all the procedure calls.  Procedure calls create roughly the same overhead as a subroutine call.

There are several drawbacks to static binding however.  First, the executable program is larger than it needs to be.  If the procedure module is used in multiple program, a separate copy of it will exist in each program.

This leads us to the main drawback of static binding.  If the procedure module needs to be changed (to fix a bug for example), all programs that use that module must be re-created (with the CRTPGM) command.

Maintainability Performance Data sharing Ease of use
Called Programs  
Internal Procedures
Procedure Copybooks
Static Binding

We see from our comparison chart that static binding of modules is comparable to procedure copybooks.  I would not recommend using procedure copybooks however, as it complicates moving forward with other ILE functionality.

There is an alternative to static binding.  By incorporating one additional step, you can take advantage of the flexibility of dynamic binding.

  Back to Using External Procedures

Next to Service Programs

Home Feedback Contents Search

Send mail to midware@midwareservices.com with questions or comments about this web site.
Copyright 2000 Midware, Ltd.

Last Modified:  August 31, 2000