Run DB2 Program (for Experienced)


Summary

For basic information, go through the IKJEFT01 Utility (for Beginners)

  • IKJEFT01 utility is used to run the DB2 program.
  • The only requirement before executing the program is that the program should have bounded successfully to the DB2 plan in the system.

Syntax -


//STEP01 EXEC PGM= IKJEFT01
//SYSPRINT DD  SYSOUT=*
//SYSTSPRT DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM (db-system-name)  			 
  RUN PROGRAM   (db2-prog-name) - 		 
      PLAN      (db2-plan-name) -  	 
      LIBRARY   ('program-load-library') 	
END                                
/*
//SYSOUT   DD  SYSOUT=*

Practical Example -


Scenario - JCL to execute program COBOLDB using IKJEFT01 utility.

RUN JCL -

----+----1----+---2---+---3---+----4---+---5---+----6----+----7--
***************************** Top of Data ****************************
//MTHUSRI  JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID                          
//********************************************************************
//*  COBOL DB2 RUN JCL                                
//********************************************************************
//BIND     EXEC PGM=IKJEFT01,DYNAMNBR=20,REGION=4096K  
//STEPLIB  DD  DSN=XXXXXX.DB2.SDSNEXIT,DISP=SHR          
//         DD  DSN=XXXXXX.DB2.SDSNLOAD,DISP=SHR                         
//SYSPRINT DD  SYSOUT=*                                 
//SYSTSPRT DD  SYSOUT=*                              
//SYSUDUMP DD  SYSOUT=*                                 
//SYSTSIN  DD  *                                       
DSN SYSTEM (DB01)                              
  RUN PROGRAM   (COBOLDB) -                      
      PLAN      (DBPLAN)  -                       
      LIBRARY   ('MTHUSR.LOADLIB')                
END                                               
/*                                                     
//SYSOUT   DD  SYSOUT=*                             
**************************** Bottom of Data ****************************

Explaining Example -

  • SYSPRINT DD - Specifies an SYSOUT DSN where all product related messages are written.
  • SYSTSPRT DD - Used to control the output from the background job.
  • SYSUDUMP - Specifies the output dataset where the dump is placed in case of an ABEND.
  • SYSTSIN – Used to specify the executable commands and/or subcommands.
Note!
  • Change the STEPLIB libraries, SYSTEM, PLAN, and LIBRARY according to the system setup, and change the PROGRAM name to the program that needs to run.
  • Once the details are updated, the above JCL can directly submit to run the program.