The COBOL-DB2 program can be executed with the help of IKJEFT01. The IKJEFT01 is an inbuilt mainframe utility that allows us to run z/OS TSO commands via Job control language(JCL). If we want to execute a COBOL-DB2 program PROGA of plan PLANA we must give a JCL step as below.
//STEP010 EXEC PGM=IKJEFT01 //STEPLIB DD DSN=DIS.TEST.LOADLIB,DISP=SHR //SYSOUT DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(TB3) RUN PROGRAM (PROGA) PLAN(PLANA) END /*
In the above JCL step, we have first used IKJEFT01 utility to call the COBOL-DB2 program. The loadlib path for the program PROGA is given in STEPLIB i.e. DIS.TEST.LOADLIB and the location to print the program logs are mentioned in SYSOUT, which is spool in this case (SYSOUT=*). Then we have used SYSTIN to give the run-time parameters like DB2 database identifier (TB3), given by DSN SYSTEM and program/plan name.
It is necessary to give a plan with the program because it gives DB2, the access path information for the queries used in programs. The DB2 then follows this access path within the database to extract the data required in the program.