Previous Topic: Writing the ApplicationNext Topic: Executing the Application


Creating Executable Modules

Since the application program contains an embedded sublanguage, you precompile the program to create a module of the SQL statements (an RCM) that is separate from program source. You also create an access module that contains an optimized access strategy for the SQL statements in one or more RCMs.

Precompiling the Program

The precompiler converts embedded SQL statements to internal form and stores them in a module called an RCM. It replaces embedded SQL in the source module with calls to the DBMS. These calls, unlike the SQL statements they replace, are intelligible to the language compiler.

The precompiler checks the syntax of the embedded SQL. If there are syntax errors, it issues an error report instead of storing the RCM.

Compiling the Program

After the program precompiles successfully, you compile and link the modified source program to create an executable program load module.

Creating an Access Module

The load module that is executed when the program requests database access is the access module. You must create the access module before executing the program.

An access module is built using one or more RCMs. Each RCM represents the SQL statements from a single source program or CA ADS dialog.

When you create an access module, the optimizer performs these functions on each SQL statement from each RCM that you include in the access module:

What Information the Optimizer Uses

To develop an optimized access strategy for an SQL statement, the optimizer considers:

Summary of Program Preparation

These are the steps you take to make the application executable:

  1. Precompile the programs
  2. Compile and link the programs
  3. Create the access module

For more information about how you take these steps, see Preparing and Executing the Program.

The next flow chart shows the result of each step in the process: