Submit TSO Commands
Submit TSO Commands (for Experienced)
Summary
For basic information, go through the IKJEFT01 Utility (for Beginners)
- IKJEFT01 is used to execute TSO commands via batch jobs.
- REXX can also be executed via batch Job.
Syntax -
//Job Card
//*
//STEP01 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
<TSO-Commands>
/*
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 -
- 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.
- DEL 'MTHUSR.TEST.PDSFILE' - Specifies the TSO command to delete the MTHUSR.TEST.PDSFILE.