Dataset management is a fundamental aspect of working with mainframes. ISPF provides comprehensive tools and utilities for creating, modifying, organizing, and maintaining datasets. Understanding dataset management helps you effectively organize your data, maintain datasets, and perform essential operations like creating, deleting, copying, renaming, and cataloging datasets. This tutorial covers the complete dataset management workflow using ISPF utilities and tools.
Effective dataset management involves understanding dataset types, attributes, and the various ISPF utilities available for dataset operations. Whether you're creating new datasets, organizing existing ones, performing maintenance, or managing PDS members, ISPF provides the tools you need. This tutorial provides practical guidance for all aspects of dataset management in ISPF.
Understanding Dataset Management
Dataset management encompasses all operations related to datasets:
Creation: Allocating new datasets with appropriate attributes and space allocation.
Modification: Changing dataset attributes, renaming datasets, or reorganizing data.
Organization: Cataloging datasets, organizing PDS members, and maintaining dataset structures.
Maintenance: Copying, moving, backing up, and maintaining datasets.
Cleanup: Deleting unused datasets, compressing PDS datasets, and managing space.
Discovery: Finding datasets, listing datasets, and viewing dataset information.
ISPF Utilities for Dataset Management
ISPF provides several utilities specifically designed for dataset management:
Option 3.2 - Data Set Utility
The Data Set Utility is the primary tool for dataset-level operations:
Allocate: Create new datasets with specified attributes and space allocation.
Delete: Delete datasets permanently (use with caution).
Rename: Rename datasets while preserving data and attributes.
Catalog/Uncatalog: Add datasets to or remove datasets from the system catalog.
List: View dataset attributes, space information, and other properties.
Modify Attributes: Change certain dataset attributes (with limitations).
GDG Management: Define and manage Generation Data Groups.
Option 3.1 - Library Utility
The Library Utility manages PDS and PDSE members:
Member Lists: Browse and display member lists for partitioned datasets.
Member Operations: Copy, move, delete, and rename members within or between PDS datasets.
Member Attributes: View member attributes, sizes, and modification dates.
Member Search: Search for members by name patterns.
Member Comparison: Compare members to identify differences.
Option 3.3 - Move/Copy Utility
The Move/Copy Utility handles dataset copying and movement:
Copy Datasets: Create copies of datasets, preserving all data and attributes.
Move Datasets: Move datasets to new locations or rename during movement.
Member Copying: Copy individual members between PDS datasets.
Bulk Operations: Perform copy or move operations on multiple datasets.
Backup Operations: Create backup copies of datasets.
Option 3.4 - DSLIST (Data Set List)
DSLIST provides dataset discovery and listing capabilities:
Dataset Listing: Display lists of datasets matching name patterns.
Sorting and Filtering: Sort datasets by various attributes and filter lists.
Bulk Operations: Perform operations on multiple datasets from lists.
Dataset Information: View dataset attributes and information for listed datasets.
Pattern Matching: Find datasets using wildcards and patterns.
Creating Datasets
Creating (allocating) datasets is one of the most common dataset management tasks:
Using Data Set Utility to Allocate
To create a new dataset using Data Set Utility:
Access Utility: Select Option 3 (Utilities) from the Primary Option Menu, then select Option 3.2 (Data Set Utility).
Select Allocate: From the Data Set Utility menu, select the Allocate option.
Enter Dataset Name: Enter the dataset name in the appropriate field. Use fully qualified names (in quotes) or rely on your default prefix.
Dataset organization (PS for sequential, PO for PDS/PDSE)
Record format (F, V, FB, VB, U, etc.)
Record length (LRECL)
Block size (BLKSIZE)
Space allocation (tracks, cylinders, or blocks)
Directory blocks (for PDS)
Catalog Option: Choose whether to catalog the dataset (recommended for most cases).
Confirm Allocation: Review settings and confirm to create the dataset.
Dataset Attributes for Allocation
When allocating datasets, you must specify key attributes:
Data Set Organization (DSORG): PS for sequential, PO for partitioned (PDS/PDSE). This determines the dataset structure and cannot be changed after creation.
Record Format (RECFM): F (fixed), V (variable), FB (fixed blocked), VB (variable blocked), U (undefined). This determines how records are stored.
Record Length (LRECL): The length of records in bytes. Must match your data requirements.
Block Size (BLKSIZE): The size of data blocks. Affects I/O efficiency and space usage.
Space Allocation: Primary and secondary space allocation in tracks, cylinders, or blocks. Determines how much space is initially allocated and how much is added when needed.
Directory Blocks: For PDS datasets, the number of directory blocks determines how many members can be stored.
Deleting Datasets
Deleting datasets permanently removes them and their data:
Using Data Set Utility to Delete
To delete a dataset:
Access Utility: Select Option 3.2 (Data Set Utility) from the Utilities menu.
Select Delete: Select the Delete option from the Data Set Utility menu.
Enter Dataset Name: Enter the name of the dataset you want to delete. Be very careful to enter the correct name.
Confirm Deletion: Review the dataset name and confirm deletion. Some systems may require additional confirmation.
Deletion Executes: The dataset and all its data are permanently deleted. This action cannot be undone.
Deletion Considerations
Important considerations when deleting datasets:
Permanent Action: Deletion is permanent—there is no "undo" for dataset deletion. Once deleted, data cannot be recovered unless you have backups.
Verify Names: Always verify dataset names before deletion to avoid deleting the wrong dataset. Double-check names, especially for important datasets.
Check Dependencies: Ensure no programs or jobs depend on the dataset before deleting it. Deleting a dataset that's in use can cause errors.
Backup First: Consider backing up important datasets before deletion, even if you're sure you want to delete them.
Permissions: You may need specific permissions to delete datasets. Some datasets may be protected from deletion.
Catalog Status: Deletion removes the dataset from the catalog (if cataloged) and deletes the data. Both catalog entry and data are removed.
Renaming Datasets
Renaming datasets changes their names while preserving data and attributes:
Using Data Set Utility to Rename
To rename a dataset:
Access Utility: Select Option 3.2 (Data Set Utility).
Select Rename: Select the Rename option from the menu.
Enter Current Name: Enter the current dataset name.
Enter New Name: Enter the new dataset name you want.
Confirm Rename: Review both names and confirm the rename operation.
Rename Executes: The dataset is renamed, preserving all data and attributes. The catalog entry is updated with the new name.
Rename Considerations
Considerations when renaming datasets:
Name Availability: The new name must not already exist. If a dataset with the new name exists, the rename will fail.
Catalog Updates: If the dataset is cataloged, the catalog entry is updated with the new name automatically.
References: Update any programs, JCL, or references that use the old dataset name to use the new name.
Permissions: You need appropriate permissions to rename datasets. Some datasets may be protected from renaming.
Data Preservation: All data, attributes, and members (for PDS) are preserved during rename. Only the name changes.
Copying and Moving Datasets
Copying and moving datasets are essential for backup, migration, and reorganization:
Using Move/Copy Utility
To copy or move datasets:
Access Utility: Select Option 3.3 (Move/Copy Utility) from the Utilities menu.
Select Operation: Choose Copy to create a duplicate, or Move to relocate the dataset.
Enter Source: Enter the source dataset name (the dataset to copy or move from).
Enter Target: Enter the target dataset name (where to copy or move to). For moves, this can be a new name or location.
Specify Options: Configure copy/move options such as replacing existing datasets, member selection (for PDS), and other settings.
Execute Operation: Confirm and execute the copy or move operation.
Copy vs. Move
Understanding the difference:
Copy: Creates a duplicate of the source dataset. The original dataset remains unchanged and both datasets exist after the operation. Use copy for backups, creating test datasets, or duplicating data.
Move: Relocates the dataset from source to target. The source dataset is deleted after the move, and only the target dataset exists. Use move for reorganizing datasets or relocating data.
Member Operations: For PDS datasets, you can copy or move individual members between datasets, allowing selective copying or movement of specific members.
Cataloging and Uncataloging
Cataloging makes datasets accessible by name without specifying volume:
Cataloging Datasets
To catalog a dataset:
Access Utility: Select Option 3.2 (Data Set Utility).
Select Catalog: Select the Catalog option.
Enter Dataset Name: Enter the dataset name to catalog.
Specify Volume: If the dataset is not already on a volume, you may need to specify the volume serial number.
Confirm Catalog: Confirm the catalog operation.
Catalog Entry Created: A catalog entry is created, allowing the dataset to be accessed by name alone.
Uncataloging Datasets
To uncatalog a dataset:
Access Utility: Select Option 3.2 (Data Set Utility).
Select Uncatalog: Select the Uncatalog option.
Enter Dataset Name: Enter the dataset name to uncatalog.
Confirm Uncatalog: Confirm the uncatalog operation.
Catalog Entry Removed: The catalog entry is removed, but the dataset and its data remain. The dataset can still be accessed by specifying the volume.
Catalog Benefits
Cataloging provides several benefits:
Name-Based Access: Cataloged datasets can be accessed by name alone without specifying volume serial numbers.
Easier Reference: Programs and JCL can reference cataloged datasets by name, making them easier to use.
Volume Independence: Cataloged datasets can be moved between volumes while maintaining name-based access.
System Integration: Cataloged datasets integrate better with system functions and utilities.
Viewing Dataset Information
Viewing dataset attributes and information helps you understand and manage datasets:
Using Data Set Utility to List
To view dataset information:
Access Utility: Select Option 3.2 (Data Set Utility).
Select List: Select the List option (or Information option, depending on ISPF version).
Enter Dataset Name: Enter the dataset name you want to view.
View Information: The utility displays dataset attributes, space information, catalog status, and other properties.
Space Information: Allocated space, used space, and available space.
Catalog Status: Whether the dataset is cataloged and catalog information.
Volume Information: Volume serial numbers where the dataset resides.
Creation Date: When the dataset was created.
Other Attributes: Additional attributes depending on dataset type and system.
Managing PDS Members
PDS member management is handled by the Library Utility:
Using Library Utility
To manage PDS members:
Access Utility: Select Option 3.1 (Library Utility) from the Utilities menu.
Enter Dataset Name: Enter the PDS dataset name to work with.
View Member List: The utility displays a list of all members in the PDS.
Select Operations: Use line commands or menu options to perform operations on members:
B (Browse): View member content
E (Edit): Edit member content
D (Delete): Delete a member
R (Rename): Rename a member
C (Copy): Copy a member
M (Move): Move a member
Execute Operations: Execute selected operations to manage members.
Finding Datasets with DSLIST
DSLIST helps you find and manage multiple datasets:
Using DSLIST
To use DSLIST for dataset discovery:
Access DSLIST: Select Option 3.4 (DSLIST) from the Utilities menu.
Enter Pattern: Enter a dataset name pattern using wildcards. For example, "USERID.*.COBOL" finds all datasets with COBOL as the last qualifier.
View List: DSLIST displays all datasets matching the pattern.
Sort and Filter: Use DSLIST options to sort datasets by name, date, size, or other attributes, and filter lists.
Perform Operations: Use line commands to perform operations on listed datasets, such as browsing, editing, deleting, or copying.
DSLIST Features
DSLIST provides powerful features:
Pattern Matching: Use wildcards (* and %) to find datasets matching patterns.
Sorting: Sort datasets by name, creation date, size, or other attributes.
Filtering: Filter lists to show only datasets matching specific criteria.
Bulk Operations: Select multiple datasets and perform operations on them.
Information Display: View dataset attributes and information for listed datasets.
Best Practices for Dataset Management
Following best practices helps you manage datasets effectively and safely:
Use Meaningful Names: Choose dataset names that clearly indicate their purpose and content. Follow naming conventions used in your organization.
Catalog Important Datasets: Catalog datasets you use regularly to enable name-based access and easier reference.
Verify Before Deleting: Always verify dataset names before deletion. Double-check names, especially for important datasets.
Backup Important Data: Regularly backup important datasets. Use copy operations to create backup copies before making significant changes.
Organize with PDS: Use PDS or PDSE datasets to organize related files (like source code libraries) together.
Monitor Space Usage: Regularly check dataset space usage to identify datasets that need attention or cleanup.
Use DSLIST for Discovery: Use DSLIST to find datasets when you know part of the name or want to see related datasets.
Understand Attributes: Understand dataset attributes and choose appropriate values when creating datasets. Attributes cannot be changed after creation for some properties.
Clean Up Regularly: Periodically review and clean up unused datasets to free space and maintain organization.
Document Important Datasets: Document important datasets, their purposes, and any special considerations for future reference.
Explain Like I'm 5: Dataset Management
Think of dataset management like organizing your toys:
Creating Datasets is like getting a new toy box. You decide what size it should be, what it's for, and give it a name. Then you can put toys (data) in it!
Deleting Datasets is like throwing away a toy box with all the toys inside. Once you throw it away, you can't get it back, so you have to be very sure you want to throw it away!
Renaming Datasets is like putting a new label on your toy box. The box and all the toys stay the same, but it has a different name now!
Copying Datasets is like making a copy of your toy box with all the same toys. Now you have two identical toy boxes—the original and the copy!
Cataloging is like putting your toy box in a special catalog so you can find it by name without remembering exactly where it is. It's like having a list that says "My Red Car Box is in the closet"!
PDS Members are like having a big toy box with drawers. Each drawer has a label (member name), and you can open any drawer to get those specific toys. Managing members is like organizing the drawers!
DSLIST is like having a magic list that shows you all your toy boxes that match what you're looking for. You can say "show me all boxes with 'car' in the name" and it shows you all of them!
So dataset management is like organizing, finding, copying, renaming, and taking care of your data "toy boxes" on the computer!
Practice Exercises
Complete these exercises to reinforce your understanding of dataset management:
Exercise 1: Creating Datasets
Practice creating datasets: use Data Set Utility to allocate new datasets with different attributes (sequential, PDS), experiment with different record formats and space allocations, and understand how attributes affect dataset creation. Build familiarity with dataset allocation.
Exercise 2: Viewing Dataset Information
Practice viewing information: use Data Set Utility to list dataset attributes, examine space information, check catalog status, and understand what information is displayed. Learn to interpret dataset attributes and information.
Exercise 3: Copying and Moving
Practice copying and moving: use Move/Copy Utility to copy datasets, move datasets, copy PDS members, and understand the differences between copy and move operations. Practice backup and migration scenarios.
Exercise 4: Managing PDS Members
Practice member management: use Library Utility to browse member lists, copy members, delete members, rename members, and perform other member operations. Understand PDS member management workflows.
Exercise 5: Using DSLIST
Practice with DSLIST: use DSLIST to find datasets using patterns, sort and filter lists, view dataset information, and perform operations on multiple datasets. Build skills in dataset discovery and bulk operations.
Test Your Knowledge
1. Which ISPF utility is used to create new datasets?
Option 3.1 (Library Utility)
Option 3.2 (Data Set Utility)
Option 3.3 (Move/Copy Utility)
Option 3.4 (DSLIST)
2. What does cataloging a dataset do?
Deletes the dataset
Adds the dataset to the system catalog for name-based access
Copies the dataset
Renames the dataset
3. Which utility is used to manage PDS members?
Option 3.1 (Library Utility)
Option 3.2 (Data Set Utility)
Option 3.3 (Move/Copy Utility)
Option 3.4 (DSLIST)
4. What is DSLIST used for?
Editing datasets
Listing and finding datasets matching patterns
Deleting datasets
Printing datasets
5. Which utility is used to copy datasets?
Option 3.1
Option 3.2
Option 3.3 (Move/Copy Utility)
Option 3.4
6. What should you be careful about when deleting datasets?
Deletion is temporary
Deletion permanently removes the dataset and its data