DB2 program preparation overview

Before you can run an application program on DB2® for z/OS®, you need to prepare it. To prepare the program, create a load module, possibly one or more packages, and an application plan.

If your application program includes SQL statements, you need to process those SQL statements by using either the DB2 precompiler or the DB2 coprocessor that is provided with a compiler. Both the precompiler and the coprocessor perform the following actions:
  • Replaces the SQL statements in your source programs with calls to DB2 language interface modules
  • Creates a database request module (DBRM), which communicates your SQL requests to DB2 during the bind process

The following figure illustrates the program preparation process when you use the DB2 precompiler. After you process SQL statements in your source program by using the DB2 precompiler, you create a load module, possibly one or more packages, and an application plan. Creating a load module involves compiling the modified source code that is produced by the precompiler into an object program, and link-editing the object program to create a load module. Creating a package or an application plan, a process unique to DB2, involves binding one or more DBRMs, which are created by the DB2 precompiler, using the BIND PACKAGE command.

Start of change
Figure 1. Program preparation with the DB2 precompiler
Begin figure summary.The figure shows the process of using the DB2 precompiler to create a load module and a plan. Detailed description available.
End of change

The following figure illustrates the program preparation process when you use the DB2 coprocessor. The process is similar to the process for the DB2 precompiler, except that the DB2 coprocessor does not create modified source for your application program.

Start of change
Figure 2. Program preparation with the DB2 coprocessor
Begin figure summary.The figure shows the process of using the DB2 coprocessor to create a load module and a plan. Detailed description available.
End of change