IEFBR14
Using IEFBR14 to delete a file. If the file is not found,
there will be no error message and no high return code.
//ERASE EXEC PGM=IEFBR14
//OUTPDS DD DSN=your-id.name-of-backup-lib,DISP=(MOD,DELETE),
// UNIT=SYSDA,SPACE=(TRK,0)
//*
Using IEFBR14 to avoid deleting and reallocating a file.
If you run a job frequently, and it needs the same
output dataset each time, you can use this JCL.
It finds the dataset, if it already exists.
Then it clobbers it, avoiding the overhead of reallocating.
Note that the disposition on the step that actually uses
the file, later in the job, must be (OLD,CATLG)
If the dataset doesn't exist, it is created.
//FINDPASS EXEC PGM=IEFBR14
//DD1 DD DSN=dsn-to-be-used-later-in-job,
// UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(MOD,PASS),
// LRECL=133,RECFM=FB,BLKSIZE=27930
//*