DELETE Command (for Experienced)
Summary
For basic information, go through the DELETE Command (for Beginners)
The DELETE command is used to delete catalogs, VSAM datasets, and non-VSAM datasets.
High-level syntax -
//JOBNAME JOB job-card-parameters
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE Command
/*
Detail syntax -
//JOBNAME JOB job-card-parameters
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (entryname[ entryname ...])
[ALIAS|
ALTERNATEINDEX|
CLUSTER|
GENERATIONDATAGROUP|
LIBRARYENTRY|
NONVSAM|
PAGESPACE|
PATH|
USERCATALOG|
VOLUMEENTRY]
[ERASE|NOERASE]
[FILE(ddname)]
[FORCE|NOFORCE]
[MASK|NOMASK]
[PURGE|NOPURGE]
[RECOVERY|NORECOVERY]
[SCRATCH|NOSCRATCH]
[CATALOG(catname)]
/*
Parameters
The DELETE command mandatory and optional parameters are specified below -
Mandatory Parameters
(entryname[ entryname...])
- Specifies the entry name to be deleted.
- If trying to delete more than one entry, those entry names must enclose the list of entry names in parentheses.
- The maximum entrynames can specify 100.
- We can use the generic name to delete multiple entries with the entryname—for example, MATEPK.EMPL.* is a generic name where * is any 1-to-8 character simple name.
Optional Parameters
ALIAS | ALTERNATEINDEX | CLUSTER | GENERATIONDATAGROUP | LIBRARYENTRY | NONVSAM | PAGESPACE | PATH | USERCATALOG | VOLUMEENTRY
- Specifies the object type or entry to be deleted.
CATALOG(catname)
- Specifies the catalog name that contains the entries to be deleted.
- This parameter cannot use to delete a user catalog.
Short Description: CAT
ERASE
- Specifies cluster components are to be overwritten with binary zeros when the cluster or AIX is deleted.
- If ERASE is specified, the data component volume must be mounted.
Short Description: ERAS
NOERASE
- Specifies cluster components are not to be overwritten with binary zeros when the cluster or alternate index is deleted.
Short Description: NERAS
FILE(ddname)
- Specifies the DDname that identifies the volume, dataset, and partitioned dataset.
- The FILE parameter improves the DELETE command performance.
FORCE
- FORCE parameter deletes generation data groups, tape library entries, and user catalogs without ensuring that these entries are empty.
Short Description: FRC
NOFORCE
- Specifies the DELETE command to end when the deletion of a gdg, tape library entry, or user catalog is not empty.
Short Description: NFRC
MASK
- The MASK parameter specifies entryname is a filter key. For example - if DELETE MATEPK.* is specified, it deletes all entries starting with MATEPK.
NOMASK
- The NOMASK parameter specifies entryname should be a fully qualified name. For example - no entries get deleted if DELETE MATEPK.* is specified.
- NOMASK is the default.
PURGE
- Specifies the entry is deleted even if the retention period, TO or FOR parameter, has not expired.
Short Description: PRG
NOPURGE
- Specifies the entry is not deleted if the retention period has not expired.
Short Description: NPRG
RECOVERY
- When RECOVERY is specified, the user catalog, a VSAM volume data set (VVDS), or a generation data group (GDG) will be replaced with an imported backup copy.
Short Description: RCVRY
NORECOVERY
- Specifies the dataset should not be replaced and indicates that the entry is to be processed as described by the other parameters.
Short Description: NRCVRY
SCRATCH
- Specifies the dataset is to be scratched from the volume on which it resides. For VSAM datasets and non-VSAM datasets, the VSAM volume data set (VVDS) entry is also removed.
- This parameter can specify only for a cluster, AIX, a page space, or a non-VSAM data set.
Short Description: SCR
NOSCRATCH
- Specifies the catalog entry is deleted from the catalog without mounting the volume.
Short Description: NSCR
Example -
Requirement - Delete ESDS file.
Input ESDS File - MATEPK.TEST.ESDS
Code -
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//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'
/*
**************************** Bottom of Data ****************************
In the above JCL, MATEPK is the userid and change it as required.
Output -
Once the above JCL is submitted, check the MAXCC of the job for any errors. If the MAXCC is 00 or 04, then REPRO is successful..
********************************* TOP OF DATA **********************************
IDCAMS SYSTEM SERVICES TIME: 07:58:53
DELETE 'MATEPK.TEST.ESDS'
IDC0550I ENTRY (D) MATEPK.TEST.ESDS.DATA DELETED
IDC0550I ENTRY (C) MATEPK.TEST.ESDS DELETED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0
******************************** BOTTOM OF DATA ********************************
Verify the path in 3.4 (Dataset List utility) or any File management tools.