Run DB2 Program Example


Scenario - JCL to execute program (SELECT1) using IKJEFT01 utility.

RUN JCL -

----+----1----+---2---+---3---+----4---+---5---+
//MATEPKR JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID     
//***********************************************
//*  COBOL DB2 RUN JCL                          
//***********************************************                                             
//STEP01   EXEC PGM=IKJEFT01,
//             DYNAMNBR=20,REGION=4096K
//STEPLIB  DD  DISP=SHR,DSN=DSNA10.DBAG.SDSNEXIT
//         DD  DISP=SHR,DSN=DSNA10.SDSNLOAD
//SYSTSIN  DD  *
  DSN SYSTEM (DBAG)
  RUN PROGRAM   (SELECT1)  -
      PLAN      (MATEPKA ) -
      LIBRARY   ('MATEPK.COBDB2.LOADLIB')
END
/*
//SYSPRINT DD  SYSOUT=*
//SYSTSPRT DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*

Explaining Example -

  • SYSTEM (DBAG) - Specifies the database name (DBAG).
  • PROGRAM (SELECT1) - Specifies the running module name.
  • PLAN (MATEPKA ) - Specifies the plan name to which the program was bound.
  • MATEPK.COBDB2.LOADLIB – Specifies the load library where the program load module was stored.
Note!

Change the STEPLIB libraries, SYSTEM, and PLAN according to the system setup, and change the LIBRARY and PROGRAM name to the program that needs to run. Once the details are updated, the above JCL can directly submit to run the program.