Importance of the Order of Exports
With only a slight change to the command, you can create a different,
but potentially equally valid, program. The order in which objects
are specified on the MODULE, BNDSRVPGM, and BNDDIR parameters is usually
important only if both of the following are true:
- Multiple modules or service programs are exporting duplicate symbol names
- Another module needs to import the symbol name
The following examples show how symbol resolution works. The modules, service programs, and binding directories in Figure 1 are used for the CRTPGM requests in Figure 1 and Figure 1. Assume that all the identified exports and imports are procedures.
The examples also show the role of binding directories in the program-creation
process. Assume that library MYLIB is in the library list for the
CRTPGM and CRTSRVPGM commands. The following command creates binding
directory L in library MYLIB:
CRTBNDDIR BNDDIR(MYLIB/L)The following command adds the names of modules M1 and M2 and of
service programs S and T to binding directory L:
ADDBNDDIRE BNDDIR(MYLIB/L) OBJ((M1 *MODULE) (M2 *MODULE) (S) (T))