DB2 Server for VSE & VM: Application Programming
After compilation, programs must be link-edited and loaded before they can
be run.
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.
When link-editing a module that uses CICS/VSE, you should include the
following procedures for your application:
- For all assembler applications, you must have an INCLUDE for CICS/VSE
module DFHEAI immediately following the PHASE system control statement and
before the EXEC ASSEMBLY system control statement. DFHEAI must be the
phase entry point.
- For all C applications, you must have an INCLUDE for CICS/VSE module
DFHELII. This module must be the phase entry point.
- For all COBOL applications, you must have an INCLUDE for CICS/VSE module
DFHECI immediately following the PHASE system control statement and before the
EXEC IGYCRCTL (EXEC FCOBOL in OS/VS COBOL) system control statement. DFHECI must be the phase entry
point.
- For all PL/I applications, you must have an INCLUDE for CICS/VSE module
DFHPL1I immediately following the PHASE system control statement and before
the EXEC PLIOPT (EXEC IEL1AA in IBM PL/I for VSE) system control statement. DFHPL1I must be the phase entry
point.
See Figure 53 for an example of these procedures.
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:
- For all batch and ICCF applications, you must include the linkage module
ARIPRDID.
- For all online (CICS/VSE) applications, you must include the linkage
module ARIRRTED.
In addition to the modules listed above, some of these may be
required:
- For all programs written in COBOL (regardless of whether they are batch,
ICCF, or online), you must also include the module ARIPADR4. Include
ARIPADR if your program was preprocessed prior to SQL/DS Version 2 Release
2. (You need not include it if VSE autolink is used.)
Note: | If you use a COBOL SORT in your program, include ARIPADR4 (or ARIPADR) and
ARIPRDID (or ARIRRTED) before the compile step.
|
- For all programs written in FORTRAN, you must also include the modules
ARIPEIFA and ARIPSTR. If the FORTRAN program uses the module ARISSMF,
this file must also be included. See the discussion of the SQLCA in Chapter 6, Testing and Debugging.
- For all programs that will include the DBS utility (regardless of whether
they are batch, ICCF, or online), you must also include the modules ARISYSDD,
ARIDSQLA, and ARIDDFP.
- All programs (except FORTRAN programs) that use the module ARISSMA, must
also link-edit this module. See the discussion of the SQLCA in Chapter 6, Testing and Debugging for further information.
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 ]