XDELETE: Delete multiple Data Sets using generic Name in TSO/E

                 

Overview

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.

SYNTAX

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:
 
DSNAME Level   Data Set List
SYS1.PARMLIB One data set name
SYS1.* All data set names with SYS1 as the first qualifier and one more qualifier
SYS1 or          SYS1.** All data set names with SYS1 as the first qualifier
**.LIST All data set names with a qualifier of LIST
AAA%*.B*%%%B All data sets that start with AAA have at least one more character in the high level qualifier and have a second qualifier that begins and ends in B with at least 3 letters between the Bs

Data set name qualifiers can be partially specified using asterisks as global file-name characters and percent signs as placeholders:

  • * A single asterisk by itself indicates that at least one qualifier is needed to occupy that position. A single asterisk within a qualifier indicates that zero or more characters can occupy that position.
  • ** A double asterisk indicates that zero or more qualifiers can occupy that position. A double asterisk within a qualifier is invalid.
  • % A single percent sign indicates that any one single alphameric or national character can occupy that position.
  • %%... One to eight percent signs can be specified in each qualifier.

INSTALLATION

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:

  1. SYS1.AOS28(ARCCSI)
  2. SYS1.AAPPMOD2(APPCSI00)

EXECUTION

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.