How do I clean up my data sets by deleting unused large datasets?

I tried to allocate a dataset and got no space available. It was time to bite the bullet and clean up my data sets.

You can do this from ISPF 3.4

   Menu  RefList  RefMode  Utilities  Help                            
─────────────────────────────────────────────────────────────────────
Data Set List Utility
Option ===>

blank Display data set list P Print data set list
V Display VTOC information PV Print VTOC information

Enter one or both of the parameters below:
Dsname Level . . . COLIN.* A*
Volume serial . .

Data set list options
Initial View Enter "/" to select option
4 1. Volume / Confirm Data Set Delete
2. Space / Confirm Member Delete
3. Attrib / Include Additional Qualifiers
4. Total / Display Catalog Name
/ Display Total Tracks
Prefix Dsname Level

This gives output like

   Menu  Options  View  Utilities  Compilers  Help                              
──────────────────────────────────────────────────────────────────────────────
DSLIST - Data Sets Matching COLIN.* Row 1 of 831
Command ===> Scroll ===> CSR

Total Tracks: 810239 non-x: 810239 Data Sets: 831 non-x: 831
-------------------------------------------------------------------------------
Command - Enter "/" to select action Message Volume
Tracks % XT Device Dsorg Recfm Lrecl Blksz Created Referred
Catalog
-------------------------------------------------------------------------------
COLIN.$$TEMP$$ A3USR1
150 0 1 3390 PS VB 2000 6144 2024/07/27 2026/07/13
A4USR1.ICFCAT
-------------------------------------------------------------------------------
COLIN.AAA A3USR1
5 20 1 3390 PS VB 84 27998 2024/12/03 2026/07/13
A4USR1.ICFCAT
-------------------------------------------------------------------------------
...
COLIN.OPENSSL.ZFS2 *VSAM*
VS
A4USR1.ICFCAT

You can then issue commands like

  • sort tracks to look at the space used
  • sort referred to see when they were last used

Then use the delete command to delete the data set.

You can do this from ISMF (Interactive Storage Management Facility) in ISPF.

You can save lists for working on later.

    Panel  Help                                                                  
──────────────────────────────────────────────────────────────────────────────
ISMF PRIMARY OPTION MENU - z/OS DFSMS 3.1
Selection or Command ===>

More: +
0 ISMF Profile - Specify ISMF User Profile
1 Data Set - Perform Functions Against Data Sets
2 Volume - Perform Functions Against Volumes
....
   Panel  Defaults  Utilities  Scroll  Help                                     
──────────────────────────────────────────────────────────────────────────────
DATA SET SELECTION ENTRY PANEL Page 1 of 5
Command ===>

For a Data Set List, Select Source of Generated List . . 2 (1 or 2)

1 Generate from a Saved List Query Name To
List Name . . Save or Retrieve

2 Generate a new list from criteria below
Data Set Name . . . 'COLIN.**'
Enter "/" to select option Generate Exclusive list
Specify Source of the new list . . 2 (1 - VTOC, 2 - Catalog)
1 Generate list from VTOC
Volume Serial Number . . . (fully or partially specified)
Storage Group Name . . . . (fully specified)
2 Generate list from Catalog
Catalog Name . . .
Volume Serial Number . . . (fully or partially specified)
Acquire Data from Volume . . . . . . . Y (Y or N)
Acquire Data if DFSMShsm Migrated . . Y (Y or N)

Use ENTER to Perform Selection; Use DOWN Command to View next Selection Panel;
Use HELP Command for Help; Use END Command to Exit.

I enter the data set in quotes. If you have ISPF configured to put a HLQ prefix (such as your userid) you can use **.

You can display information from a VTOC or catalog – depending on what you want to tidy.

Acquire Data from Volume goes and gets size and date information etc.

That’s all I specified to list all my data sets. There are 5 pages of options! The second page has

 To limit the List, Specify a value or range of values in any of the following:
Rel Op Value AND/OR Rel Op Value
------ ---------- ------ ------ ----------
Allocated Space . . . . . . __ __________ ______ ______ __________
Block/CI Size . . . . . . . __ ______ ______ ______ ______
Block Unused . . . . . . . __ __________ ______ ______ __________
Creation Date . . . . . . . __ __________ ______ ______ __________
Expiration Date . . . . . . __ __________ ______ ______ __________
Last Backup Date . . . . . __ __________ ______ ______ __________
Last Reference Date . . . . __ __________ ______ ______ __________
Number of Extents . . . . . __ ___ ______ ______ ___
Number of Stripes . . . . . __ __ ______ ______ __
Optimal Block Size . . . . __ ____ ______ ______ ____
% Space Not Used . . . . . __ ___ ______ ______ ___
% User Data Reduction . . . __ __ ______ ______ __
Record Length . . . . . . . __ __________ ______ ______ __________
Secondary Allocation . . . __ __________ ______ ______ __________
Use ENTER to Perform Selection; Use UP/DOWN Command for other Selection Panel;
Use HELP Command for Help; Use END Command to Exit.

so you can refine your search, for example the last reference date.

I used

   Panel  Defaults  Utilities  Scroll  Help                                     
──────────────────────────────────────────────────────────────────────────────
DATA SET SELECTION ENTRY PANEL Page 2 of 5
Command ===>

To limit the List, Specify a value or range of values in any of the following:
Rel Op Value AND/OR Rel Op Value
------ ---------- ------ ------ ----------
...
Last Reference Date . . . . LT 2025/08/01 ______ ______ __________
...

Note: If you leave ISMF and come back in – it remembers the options previously specified, so you may need to change them. You get a short message OTHER VALUES PRESENT if there are other options specified.

When you press enter, it takes a while to list all of the data sets, and then go and collect the information about the data set.

The output is like

   Panel  List  Dataset  Utilities  Scroll  Help                                
------------------------------------------------------------------------------
DATA SET LIST
Command ===> Scroll ===> HALF
Entries 1-33 of 607
Enter Line Operators below: Data Columns 3-5 of 43

LINE ALLOC ALLOC % NOT
OPERATOR DATA SET NAME SPACE USED USED
---(1)---- ------------(2)------------ ---(3)--- ---(4)--- -(5)-
COLIN --------- --------- ---
COLIN.$$TEMP$$ 8300K 0K 100
COLIN.AAA 277K 55K 80
COLIN.AAA.PAX 830K 55K 93
COLIN.AAA.PROCLIB 9130K 8743K 4
COLIN.AAAAA 277K 55K 80

Note: the output is 80 columns wide.

The display is Entries 1-33 of 607.

There are many columns not displayed, Data Columns 3-5 of 43, you can scroll left and right.

I was interested in last referenced date, and alloc space.

Issue the VIEW command

   Panel  Utilities  Scroll  Help                                               
──────────────────────────────────────────────────────────────────────────────
DATA SET VIEW ENTRY PANEL Page 1 of 2
Command ===>

If Desired, Select option . . __ (1 - SELECT, 2 - SAVE, 3 - DELETE)
View Name . . __ (1 to 8 characters, * to Delete all,
or blank for List of Saved Views)
Specify Tags in Sequence Desired:
===> 3 22______________________________________

Line Operator (40) CF LOCK Structure Name
Data Set Name (36) CF Status Indicator
(3) Allocated Space (24) Change Indicator
(9) Allocation Unit (6) Compressed Format
(14) Block/CI Size (20) Creation Date
(16) Block Unused (25) Data Class Name
(35) CCSID Description (30) Data Set Name Type
(39) CF CACHE Set Name (34) DDM Attributes
(38) CF CACHE Structure Name (19) Device Type
(37) CF Monitor Status (29) DS Environment
(41) CF LOCK Set Name (11) DS Organization
Use ENTER to Perform Selection or Display List in VIEW Sequence;
Use DOWN for next Panel; Use HELP Command for Help; Use END Command to Exit.

The values are displayed alphabetically. 3 is Allocated Space, you need to scroll to the next page to see (22) Last Ref Date.

Press enter, and you get

   Panel  List  Dataset  Utilities  Scroll  Help                               
------------------------------------------------------------------------------
DATA SET LIST
Command ===> Scroll ===> HALF
Entries 1-33 of 607
Enter Line Operators below: View in Use

LINE ALLOC LAST REF
OPERATOR DATA SET NAME SPACE DATE
---(1)---- ------------(2)------------ ---(3)--- ---(22)---
COLIN --------- ----------
COLIN.$$TEMP$$ 8300K 2025/07/27
COLIN.AAA 277K 2025/07/27
COLIN.AAA.PAX 830K 2025/07/27
COLIN.AAA.PROCLIB 9130K 2025/07/27

with just the optional columns you specified.

The documentation says you can use the commands view save myview and view select myiew. Originally this did not work for me, due to my ISPF set up being wrong. I had to allocate my table dataset to ISPTLIB DDNAME.

You can issue the command line command sort 3, or sort 22 to sort by the column number.

The help for line commands gives

HELP-------------------  DATA SET LIST LINE OPERATORS  -------------------HELP
COMMAND ===>

Use ENTER to see the line operator descriptions in sequence or choose them
by number:

1 LINE OPERATOR 10 DUMP 20 HRECOVER
Overview 11 EDIT 21 MESSAGE
2 ALTER 12 ERASE 22 RELEASE
3 BROWSE 13 HALTERDS 23 RESTORE
4 CATLIST 14 HBACKDS 24 SECURITY
5 CLIST 15 HBDELETE 25 TSO Commands and CLISTs
6 COMPRESS 16 HDELETE 26 VSAMREC
7 CONDENSE 17 HIDE 27 VTOCLIST
8 COPY 18 HMIGRATE
9 DELETE 19 HRECALL

and the = command to do the same as the previous command.

Some commands have an abbreviation such as B for Browse. You have to enter DELETE to delete a data set (and then use = to delete more).
You can user your own CLIST command.

You can use the command line command SAVE MYLIST to save the list in a temporary ISPF table.

  Panel  Defaults  Utilities  Scroll  Help                                     
──────────────────────────────────────────────────────────────────────────────
DATA SET SELECTION ENTRY PANEL Page 1 of 5
Command ===>

For a Data Set List, Select Source of Generated List . . 1 (1 or 2)

1 Generate from a Saved List Query Name To
List Name . . MYLIST___ Save or Retrieve ________

Leave a Reply