XDELETE: Delete multiple Data Sets using generic Name in TSO/E
XDELETE is a batch or on-line TSO/E command written in REXX. It allows TSO/E users to delete multiple data sets based on a generic data set name (also called a filter).
XDELETE command scans catalogs for data set names that match a filter (such as USERID.*.C%K*.**), then issues a DELETE command for each disk data set or a DELETE NOSCRATCH for each tape data set.
By default, XDELETE runs in test mode, i.e. it builds the DELETE commands which would delete the data sets that match the specified filter, but does not execute them, i.e. data sets are not deleted. To actually execute DELETE commands, option EXECUTE must be added to the command.
XDELETE generic_name generic name specification (filter) EXECUTE indicates that DELETE commands will actually be issued for selected data sets. DELETE commands are only displayed otherwise.
Specifying the generic name (filter)
The generic name defines the level qualifiers for the data set names to be included in the list. Qualifiers can be specified fully, partially or defaulted. For data sets that are cataloged in CVOL or VSAM catalogs, the high level qualifier must be specified fully. For ICF catalogs, at least one qualifier must be partially specified. A Dsname Level of '*' or '**' or any combination of '*' and '**' qualifiers is invalid.
The following examples are valid for generic_name:
Data set name qualifiers can be partially specified using asterisks as global file-name characters and percent signs as placeholders:
XDELETE is a REXX exec which can be installed in a library concatenated to SYSEXEC, SYSPROC, or any private library accessible with the EXEC command.
The CSI module (IGGCSI00) must be available at execution time, which is always the case in OS/390 and z/OS. On older MVS/ESA systems, IGGCSI00 was available with DFSMS/MVS V1R4 or the CSI PRPQ (5799-CSI), and sometimes in the following distribution libraries:
XDELETE is invoked as a TSO command, either on-line or in batch, as shown in the following example.
//XDELETE EXEC PGM=IKJEFT01 //SYSEXEC DD DSN=GSFSOFT.FILE183.PDS,DISP=SHR //SYSTSPRT DD SYSOUT=* //SYSTSIN DD * %XDELETE ABC*.D%%FG*.** EXEC
Catalog Search Interface (CSI)
XDELETE uses the Catalog Search Interface (CSI) which was not free when IBM made it available in the mid-1990s. The documentation for the CSI can be found in DFSMS/MVS V1R4 Managing Catalogs (Appendix D) and on the Web here.