Previous Topic: Preparing DB2 Application PlansNext Topic: PF Key Assignments for the Plan and Package Editors


Program Modes

To run a program in dynamic mode, first compile the program like any other CA Ideal program and then run it. CA Ideal runs the program under its own default plan, typically IDP140DV.

To run a program in static mode, DB2 requires that you prepare an application plan that defines the program's authorizations and access paths. You can prepare the application plan from both packages and DBRMs (Database Request Modules). A package contains SQL statements that were already bound. A DBRM contains SQL statements that were not bound. If you prepare the plan from DBRMs only, you must rebind the plan when you change any program that is included in the plan. This can be extremely resource consumptive. If you prepare the plan from packages, you need only rebind the associated package when you change a program. You do not need to rebind the plan. This minimizes the impact of the bind since fewer resources are tied up during the bind.

To run in static mode, compile the CA Ideal program like any other CA Ideal program. Then complete the following steps to prepare the program for execution in static mode and bind a plan.

  1. Create a package definition, if appropriate

    CA Ideal provides fill-ins and commands for creating and maintaining package definitions.

  2. Generate the package

    A batch command, GENERATE PACKAGE, automatically prepares the program for execution in static mode and invokes the DB2 BIND command. This procedure includes preparing one CA Ideal SQL module (an Assembler program containing the SQL for the DB2 precompile) and performing the DB2 precompile, assembly, link-edit, and bind.

  3. Create the application plan definition

    CA Ideal provides fill-ins and commands for creating and maintaining application plan definitions.

  4. Generate the application plan

    A batch command, GENERATE PLAN, automatically prepares any programs included in the plan for execution in static mode and invokes the DB2 BIND command. This procedure includes preparing one or more CA Ideal SQL modules (assembler programs containing the SQL for the DB2 precompile) and performing the DB2 precompile, assembly, link-edit, and bind. If the plan includes packages, they are included only in the bind.

  5. Connect the application plan to the application for the CICS environment

    In CA Ideal, you can specify which plan an application uses. This connection must also be made using DB2TRAN and DB2ENTRY elements in CICS.

    Before you run an application, you can specify whether you require all programs to run in static mode or allow programs to run in dynamic mode. Use the SET RUN SQL command to do this.