Sign in

docs ILE Concepts

Binding Directory Processing

Binding Directory Processing

During binding, processing happens in this order:

  1. All of the modules specified on the MODULE parameter are examined. The binder determines the list of symbols imported and exported by the object. After being examined, modules are bound, in the order listed, into the program being created.
  2. All of the service programs on the BNDSRVPGM parameter are examined in the order listed. The service programs are bound only if needed to resolve an import.
  3. All of the binding directories on the BNDDIR parameter are processed in the order listed. All the objects listed in these binding directories are examined in the order listed, but they are bound only if needed to resolve imports. Duplicate entries in binding directories are silently ignored.
  4. Each module has a list of reference system objects. This list is simply a list of binding directories. The reference system objects from bound modules are processed in order such that all the reference system objects from the first module are processed first, then the objects from the second module, and so on. The objects listed in these binding directories are examined in the order listed, only as needed, and bound only if needed. This processing continues only as long as unresolved imports exist, even if OPTION(*UNRSLVREF) is used. In other words, processing objects stops when all imports are resolved.

While objects are examined, message CPD5D03, “Definition supplied multiple times for symbol”, may be signalled even if the object is not ultimately bound into the program being created.

Note that modules usually have imports that are not apparent from the module’s source code. These are added by the compiler to implement various language features that require runtime support from service programs. Use DSPMOD DETAIL(*IMPORT) to see these imports.

To see the list of imported and exported symbols for a module or service program, look at the Binder Information Listing section of a CRTPGM or CRTSRVPGM DETAIL(*EXTENDED) listing. It lists the objects that are examined during the binding.

Module or service program objects that are bound into the program or service program being created are indicated in the Binder Information Listing section of a CRTPGM or CRTSRVPGM DETAIL(*EXTENDED) listing. Once an object is created, you can also use the DSPPGM or DSPSRVPGM command DETAIL(*MODULE) to see the bound *MODULE objects, and DETAIL(*SRVPGM) to see the list of bound *SRVPGM objects.

You can use DSPMOD DETAIL(*REFSYSOBJ) to see the list of reference system objects, which are binding directories. These binding directories typically list the names of service program APIs supplied by the operating system or language runtime support. In this way, a module can be bound to its language runtime support and system APIs without the programmer having to specify anything special on the command.