Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 3: Access Method Services (AMS)


IDCAMS- DELETE Command

  • IDCAMS- DELETE command is used to delete the VSAM or non-VSAM objects such as CLUSTER, GDG, Alternate Index, Alias, CATALOG, PS file, SPACE, USERCATALOG etc.
  • Syntax:-
    DELETE - (entry-name1 [entry-name2…]) - [object-type] - [optional-paramter]
  • Where,
    • entry-name specifies the file name which we want to delete. If only single entry needs to be deleted then no parentheses required. You can delete multiple file-entries with single DELETE command
    • object-type can be ALIAS, ALTERNATEINDEX, CLUSTER, GENERATIONDATAGROUP, LIBRARYENTRY, NONVSAM, NVR, PAGESPACE, PATH, TRUENAME, USERCATALOG, VOLUMERNTRY or VVR
  • Optional parameters:-
    Parameter Description
    ERASE | NOERASE
    • Specifies whether the components of a cluster or alternate index to be deleted are to be erased(i.e. overwritten with binary zeroes)
    • When specified ERASE, entry will be removed from catalog and also the components will be immediately overwritten with binary zeroes. Preferred option for sensitive data
    • When specified NOERASE, entry will be removed from catalog but components will not be overwritten with binary zeroes
    FORCE | NOFORCE
    • Specifies whether entries that are not empty should be deleted
    • When specified FORCE, it allows you to delete entries without first ensuring that these entries are empty
    • When specified NOFORCE, it causes the DELETE command to terminate when you request deletion of entry that is not empty
    PURGE | NOPURGE
    • Specifies whether the entry is to be deleted regardless of the retention period specified
    • When specified PURGE, entry will be deleted even if the retention period is not expired
    • When specified NOPURGE, entry will not be deleted if the retention period is not expired (Default)
    SCRATCH | NOSCRATCH
    • Specifies whether a data set is to be removed from the VTOC of the volume on which it resides
    • When specified SCRATCH, entry will be removed from catalog as well as VTOC
    • When specified NOSCRATCH, entry will be removed only from catalog

Example

Use of DELETE command to delete ESDS file

//DELETEES EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE PAYT.PAYROLL.PRCSESDS.MSTR /*

Description: - Above code snippet will delete cluster ‘PAYT.PAYROLL.PRCSESDS.MSTR’ and associated data component ‘PAYT.PAYROLL.PRCSESDS.MSTR.DATA’ (even if we have not specified it explicitly). Similarly, using the same code structure, you can delete ESDS, RRDS datasets

Imp Note: - Even if you delete only CLUSTER, any associated data component and index component will be deleted automatically.



Advertisements






© copyright mainframebug.com
Privacy Policy