Delete Datasets Example


Scenario - Delete the PS and PDS using IEFBR14 utility.

Input PS File - MATEPK.IEFBR14.PSFILE
Input PDS - MATEPK.IEFBR14.PDS

JCL -

----+----1----+----2----+----3----+---4---+---5---+
//MATEPKD  JOB (123),'MTH',CLASS=A,MSGCLASS=A,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID 
//*
//STEP01   EXEC PGM=IEFBR14
//DD1      DD DSN=MATEPK.IEFBR14.PSFILE,
//            DISP=(OLD,DELETE,DELETE)
//DD2      DD DSN=MATEPK.IEFBR14.PDS,
//            DISP=(OLD,DELETE,DELETE)

Output -

Go to Spool (SDSF -> ST) and verify the status in the JESYSMSG DDname of the corresponding job.

Delete Dataset Status

Explaining Example -

  • DD1 DD ... - Specifies PS with DISP for catalog.
  • DD2 DD ... - Specifies PDS with DISP for catalog.
  • DISP=(OLD,DELETE,DELETE) - Specifies the dataset should be deleted on successful and unsuccessful completion.
  • MATEPK.IEFBR14.PSFILE  UNCATALOGED - Specifies the MATEPK.IEFBR14.PSFILE uncataloged successfully.
  • MATEPK.IEFBR14.PSFILE  DELETED - Specifies the MATEPK.IEFBR14.PSFILE deleted successfully.
  • MATEPK.IEFBR14.PDS  UNCATALOGED - Specifies the MATEPK.IEFBR14.PDS uncataloged successfully.
  • MATEPK.IEFBR14.PDS  DELETED - Specifies the MATEPK.IEFBR14.PDS deleted successfully.