DB2 Server for VSE & VM: Application Programming


Link-Editing and Loading the Program

After compilation, programs must be link-edited and loaded before they can be run.

Link-Editing the Program with Supplementary Information

Including Relocatable Modules

To allow your program to communicate with the database manager, you must link-edit your program with one or more DB2 Server for VSE relocatable modules. One of these relocatable modules is called the resource adapter stub. Every DB2 Server for VSE application program must be link-edited with this stub. FORTRAN and COBOL programs need to be link-edited with additional relocatable modules. Also, depending on the nature of your program, you may have to link-edit with others. For instance, when link-editing a module that uses CICS/VSE, you may have to INCLUDE a CICS/VSE module immediately following the PHASE system control statement and before the EXEC ASSEMBLY system control statement. Whether you INCLUDE this module depends on your host language.

When you load your program, the VSE linkage editor automatically links your program to all modules that you included. The linkage editor also resolves virtual storage addresses between files.

Including CICS/VSE Procedures

When link-editing a module that uses CICS/VSE, you should include the following procedures for your application:

See Figure 53 for an example of these procedures.

Including Extra Linkage Modules

When link-editing any DB2 Server for VSE application, you must include some extra linkage modules following the application program module that uses the database manager. Use these extra modules as indicated below:

In addition to the modules listed above, some of these may be required:

If you receive an unresolved external reference message for a module name that begins with ARI or SQL, check the link process to ensure that all required extra linkage modules are included.

Some of these modules contain entry points with names that are different from the module name. The code generated by the DB2 Server for VSE preprocessor can reference one of these entry points, depending on the SQL statements in your application.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]