Db2 program Execution process
To execute COBOL + DB2 program, the program should BIND successfully first . The execution process is depending on the executing environment.
Batch environment -
After successful BIND, the program will need a JCL to RUN. IKJEFT01 utility is used to execute the program through JCL. The below one is the RUN JCL for COBOL+DB2 program:
//S-1 EXEC PGM=IKJEFT01
//SYSIN DD *
RUN PROG (P1) PLAN (Pl1)
DSN SYSTEM (DSP/DST)
In the above,
P1 - Program name which needs to execute. Pl1 - Plan name to which the program BIND. DSP/DST - DB2 system name Z.Z.A - Library name
Online Environment -
After successful BIND, program new copy to be issued in CICS environment. Before running the module, the RCT entry for the program should be defined in the region. Otherwise, query execution will fail with -922 error.
Once the new copy successfully issued, LINKing/CALLing the program from other program is sufficient to run the COBOL + DB2 program. If the COBOL + DB2 module has a transaction associated with it, triggering transaction also initiates the execution.