IDCAMS Delete files (DELETE) Example


Scenario - Deleting ESDS file.

Input ESDS File - MATEPK.TEST.ESDS

JCL -

----+----1----+----2----+----3----+----4----+----5----+
//MATEPKD JOB (123),'MTH',CLASS=A,MSGCLASS=A,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID 
//******************************************
//* DELETING ESDS
//******************************************
//STEP01   EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
      DELETE 'MATEPK.TEST.ESDS'
/*

Output -

Once the above JCL is submitted, check the MAXCC of the job for any errors. If the MAXCC is 00 or 04, then DELETE is successful.

DELETE Sysprint

Verify the file in 3.4 (Dataset List utility) or any File management tools for the existance.