IKJEFT01 Utility (for Beginners)
Summary
For extensive information, go through the IKJEFT01 Utility (for Experienced)
- TSO/E commands need a program to execute in the background to complete the task.
- The background program used to run the TSO/E commands is called Terminal Monitor Program (TMP).
- The terminal monitor program may be one of the following - IKJEFT01, IKJEFT1A, or IKJEFT1B.
- IKJEFT1A and IKJEFT1B are not utilities and are alternates (aliases) to IKJEFT01.
Submitting a batch job with the utility IKJEFT01 can execute the TSO commands. The EXEC format is -
//stepname EXEC PGM=IKJEFT01,DYNAMNBR=nn,PARM='command'
Syntax -
//Job Card
//*************************************************************
//* IKJEFT01 UTILITY
//*************************************************************
//STEP01 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
<Operands>
/*
- 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. Data set can be used instead of an SYSOUT.
- SYSTSIN – Used to specify the executable commands and/or subcommands.
Return Codes -
- IKJEFT01 goes to the following command when a command completes with a non-zero return code, the program.
- IKJEFT01 step ends with a condition code of 12 when the command abends.
- IKJEFT1A and IKJEFT1B will generally stop processing when a command returns a non-zero return code.
Functions -
IKJEFT01 performs the below functions –
- Submit TSO commands.
- BIND COBOL + DB2 program.
- Runs COBOL + DB2 program.
- Unload DB2 table.
Submit TSO Commands -
- IKJEFT01 is used to execute TSO commands via batch jobs.
- REXX can also be executed via batch Job.
Practical Example -
Scenario - JCL to execute the TSO command to delete the dataset using IKJEFT01 utility.
JCL -
----+----1---+---2---+---3---+----4---+---5---+--6---+---7--
***************************** Top of Data ****************************
//MTHUSRI JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//********************************************************************
//* TSO EXECUTION USING IKJEFT01 UTILITY
//*******************************************************************
//STEP01 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DEL 'MTHUSR.TEST.PDSFILE'
/*
**************************** Bottom of Data ****************************
SYSTSPRT Output -

The TSO command execution status will get displayed in Spool(STSTSPRT).
Explaining Example -
- DEL 'MTHUSR.TEST.PDSFILE' - Specifies the TSO command to delete the MTHUSR.TEST.PDSFILE.
BIND DB2 Program -
DB2 program can bound to either package or plan. IKJEFT01 utility is used to bound the DBRM to the package or plan.
- If the module is a batch module (COBOL + DB2), bound the module to package is sufficient to execute.
- Suppose the module is an online module (COBOL + DB2 + CICS). In that case, RCT entries also require to execute the module after bound it to the package.
BIND to PLAN JCL -
Code -
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MTH001B JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID
//**********************************************************************
//* DB2 BIND JCL
//**********************************************************************
//BIND EXEC PGM=IKJEFT01
//STEPLIB DD DISP=SHR,DSN=XXXXXX.DBAG.SDSNEXIT
// DD DISP=SHR,DSN=XXXXXX.SDSNLOAD
//DBRMLIB DD DSN=MTH001.COBDB2.DBRMLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM (system-name)
BIND PLAN (plan-name) -
MEMBER (program-name) -
ACTION (action-options) -
ISOLATION (isolation-options) -
VALIDATE (validate-options) -
RELEASE (release-options) -
EXPLAIN (explain-options) -
OWNER (owner-id) -
QUALIFIER (qualifier-name) -
ENCODING (encoding-options)
END
/*
**************************** Bottom of Data ****************************
- MEMBER (program-name) - MEMBER is the name of the DBRM member used for the application program in the DBRM library.
- PACKAGE (package-name) - The package is a non-executable component and can contain one or more DBRMs.
- PLAN (plan-name) - The plan is an executable component and used to execute the program.
- ACTION (action-options) - The ACTION option defines whether the plan or package replaces an existing one with the same name or is new.
- ISOLATION (isolation-options) - The ISOLATION option defines how far to isolate an application/application program from the effects of other running applications/application programs.
- VALIDATE (validate-options) - VALIDATE option specifies that BIND or REBIND errors should revalidate while the program runs.
- RELEASE (release-options) - The RELEASE option is used to decide when to release resources that are used by the program.
- EXPLAIN (explain-options) - The EXPLAIN option is used to obtain information about how SQL statements are executed in the package or plan.
- OWNER (owner-id) - The OWNER option specifies the owner authorization id of the plan or package.
- QUALIFIER (qualifier-name) - The QUALIFIER specifies the implicit qualifier for the tables, views, indexes, and aliases in the plan or package.
- LIB - LIB is the library that specifies the partitioned dataset where the DBRMs are stored.
Practical Example -
Scenario - JCL to bind the COBOL + DB2 program.
Input required -
- DBRMLIB - MATEGJ.COBDB2.DBRMLIB
- PLAN - MATEGJC
BIND JCL -
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MATEGJB JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID
//**********************************************************************
//* DB2 BIND JCL
//**********************************************************************
//BIND EXEC PGM=IKJEFT01
//STEPLIB DD DISP=SHR,DSN=XXXXXX.DBAG.SDSNEXIT
// DD DISP=SHR,DSN=XXXXXX.SDSNLOAD
//DBRMLIB DD DSN=MATEGJ.COBDB2.DBRMLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM (DBAG)
BIND PLAN (MATEGJC) -
MEMBER (SELECT1) -
ACTION (REP) -
ISOLATION (CS) -
VALIDATE (BIND) -
RELEASE (COMMIT) -
OWNER (MATEGJ) -
QUALIFIER (MATEGJ) -
ENCODING (1047)
END
/*
**************************** Bottom of Data ****************************
JOB Result - MAXCC

JOB Result - BIND Step

JOB Result - BIND Step Final Report

Run DB2 Program -
- 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.
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 -
- RUN PROGRAM - Specifies the program name to run.
- PLAN - Specifies the plan where the program bound.
- LIBRARY - Specifies the load library where the program resides.
Unload DB2 Tables -
- IKJEFT01 is used to unload the DB2 table from the database and creates a flat file with the data.
- IKJEFT01 utility uses the DSNTIAUL program to unload data from DB2 tables into sequential data sets.
- The table data are not affected by the unload operation.
Practical Example -
Scenario - JCL to unload the db2 table using IKJEFT01 utility.
JCL -
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MTHUSRU JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//**********************************************************************
//* DB2 TABLE UNLOAD USING IKJEFT01
//**********************************************************************
//UNLOAD EXEC PGM=IKJEFT01,DYNAMNBR=50
//STEPLIB DD DSN=DSNDB1.DB2T.SDSNEXIT,DISP=SHR
// DD DSN=DSNDB1.DB2T.SDSNLOAD,DISP=SHR
//SYSIN DD *
SELECT * FROM EMPLOYEE WITH UR;
/*
//SYSTSIN DD *
DSN SYSTEM(DB2T)
RUN PROGRAM(DSNTIAUL) -
PLAN(DSNTIAUL) -
LIB('DSNDB1.DB2T.RUNLIB.LOAD') -
PARMS('SQL')
END
/*
//SYSREC00 DD DSN=MTHUSR.TABLE.UNLOAD,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)
//***TABLE STRUCTURE
//SYSPUNCH DD DSN=MTHUSR.TABLE.SYSPUNCH,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
**************************** Bottom of Data ****************************
SYSTSPRT Output -

Explaining Example -
- SYSIN DD * - Specifies the input dataset and contains the Db2 query for data selection criteria from the table.
- SYSRECnn DD * - Specifies the output dataset used to store the unloaded data from the table. The value nn ranges from 00 to 99. It can have a maximum of 100 datasets for the single execution of DSNTIAUL.
- SYSPUNCH DD * - Specifies the output dataset used to store the table structure and to write the LOAD utility's control statements.