• tutorials
  • ibm-z-os
  • recipes-for-performing-basic-dataset-manipulations-with-ispf

Recipes for Performing Basic Dataset Manipulations using the tools provided in ISPF

Start working with datasets quickly: create, move, copy, rename, delete datasets as well as their members (for PDSEs).

The following recipes are based on the contents of the Exercise 2 from the "Getting Started on Mainframe with z/OS" Exercise Guide by IBM for allocating PS and PDSE datasets from scratch and the Exercise 5 for the rest. I published them here as a quick reminder, they are best used after doing the exercise from the guide first.

Note there are TSOCA03.ES10.INDATA and TSOCA03.ES10.OUTDATA partitioned data sets (PDSE) used for manipulations here in most cases, don't forget to replace their qualifiers (like Project, Group, Type) with your own!

Tip you can use the Tab key to efficiently move the cursor across the utilities' fields.



 
----------------------------------------------------
   Allocating a Physical Sequential Data Set (PS)   
----------------------------------------------------

* Enter =3.2 on the command line (from any panel) to go to the ISPF Data Set Utility panel

* Press Enter

* Enter A in the Option field

* Under ISPF Library, enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    PS

* Press Enter

* Enter/modify the following fields (leaving others as is):
	- Space units:        TRKS
	- Primary quantity:   2
	- Secondary quantity: 1
	- Record format:      FB
	- Record length:      80

* Press Enter

* Optionally, press Enter again to display the allocattion attributes

'''
Note: PS organization stays for Physical Sequential;
      FB format stays for Fixed Blocked length records (all the record have the same length)
'''



 
-------------------------------------------------------
   Allocating a Partitioned Data Set Extended (PDSE)   
-------------------------------------------------------

* Enter =3.2 on the command line (from any panel) to go to the ISPF Data Set Utility

* Press Enter

* Enter A in the Option field

* Under ISPF Library, enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    PDSE

* Press Enter

* Enter/modify the following fields (leaving others as is):
	- Space units:        TRKS
	- Primary quantity:   5
	- Secondary quantity: 1
	- Directory blocks:   [ ] (leave blank)
	- Record format:      FB
	- Record length:      80
	- Data set name type: LIBRARY

'''
Note: the LIBRARY type is what makes the data set a PDSE
'''

* Press Enter

* Optionally, press Enter again to display the allocattion attributes




-----------------------------------------------------------------------------------------------------
   Allocating a new data set TSOCA03.ES10.INDATA that has the same attributes as TSOCA03.ES10.PDSE   
-----------------------------------------------------------------------------------------------------

* Enter =3.2 on the command line (from any panel) to go to the ISPF Data Set Utility

* Press Enter

* Under ISPF Library, enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    PDSE

* Press Enter (to display Data Set Information page)

'''
Note: having displayed the data set attributes, ISPF now remembers 
them and will use them when you allocate a new data set
'''

* Press Enter (to go back to Data Set Utility page)

* Enter A in the Option field

* Tab to Type under ISPF Library and enter INDATA (Type: INDATA)

* Press Enter

* Press Enter to accept the displayed attributes and allocate (create) the data set




----------------------------------------------------------------------------------------
   Creating and editing a new member called A in TSOCA03.ES10.INDATA using the Editor   
----------------------------------------------------------------------------------------

* Enter =2 on the command line (from any panel) to go to Edit Entry Panel

* Press Enter

* Make sure that ISPF Library contains:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    INDATA
	- Member:  A

* Press Enter (to open the editor)

* Optionally, to enable UNDO and remove the warning message,
  enter REC ON (RECOVERY ON) and press Enter

* Insert some text in member A (here are some useful ISPF Editor's line commands for string manipulations)

* Press F3 (to save the member to disk and close the editor)




------------------------------------------------------------------------
   Copying member A to D of TSOCA03.ES10.INDATA with the Copy Utility   
------------------------------------------------------------------------

* Enter =3.3 on the command line (from any panel) to go to the Move/Copy Utility

* Press Enter

* Enter C in the Option field

* Enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    INDATA
	- Member:  A

* Press Enter

* Tab to Member and enter D

* Press Enter

* Optionally, press F1 to get more information about the "Member A copied" message




-----------------------------------------------------------------------------------------------------
   Copying the entire data set TSOCA03.ES10.INDATA into TSOCA03.ES10.OUTDATA with the Copy Utility   
-----------------------------------------------------------------------------------------------------

* Enter =3.3 on the command line (from any panel) to go to the Move/Copy Utility

* Press Enter

* Enter C in the Option field

* Enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    INDATA
	- Member:  *

* Press Enter

* Tab to Type and enter OUTDATA

* Press Enter

* Enter 1 (to choose the option 1 "Using the attributes of: TSOCA03.ES10.INDATA)  

* Press Enter




------------------------------------------------------------------------
   Selectively replacing only D and H members of TSOCA03.ES10.OUTDATA 
   with D and H members of TSOCA03.ES10.INDATA using the Copy Utility   
------------------------------------------------------------------------

* Enter =3.3 on the command line (from any panel) to go to the Move/Copy Utility

* Press Enter

* Enter C in the Option field

* Enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    INDATA
	- Member:  (leave empty) 

* Press Enter

* Tab to Type under ISPF Library and enter OUTDATA

* Tab to "Replace like-named members" and enter a slash ("/")

* Press Enter

'''
Note: this time ISPF displays the list of all members in TSOCA03.ES10.INDATA,
because the member field was left blank in the "From" data set
'''

* Tab to D and enter S (stays for SELECT), then to H and enter S again 

* Press Enter

'''
Note: "*REPL" next to D and H confirm the members have been replaced
'''



-------------------------------------------------------
   Deleting the entire data set TSOCA03.ES10.OUTDATA   
-------------------------------------------------------

* Enter =3.2 on the command line (from any panel) to open the Data Set Utility

* Press Enter

* Enter D on the command line

* Under ISPF Library, enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    OUTDATA

* Press Enter

* Press Enter (to confirm deletion)



 
--------------------------------------------------------
   Renaming TSOCA03.ES10.OUTDATA to TSOCA03.ES10.DATA   
--------------------------------------------------------

* Enter =3.2 on the command line (from any panel) to open the Data Set Utility

* Press Enter

* Enter R on the command line

* Under ISPF Library, enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type: OUTDATA

* Press Enter

* Tab to Type under ISPF Library and change OUTDATA to DATA

* Press Enter

'''
Note: there is a similar recipe which uses Data Set List Utility (=3.4) instead
'''


 
-----------------------------------------------------------------
   Deleting all members in TSOCA03.ES10.OUTDATA except A and C   
-----------------------------------------------------------------

* Enter =3.1 on the command line (from any panel) to open the Library Utility

* Press Enter

* Under ISPF Library, enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    OUTDATA

* Press Enter

* Enter D next to all members, except A and C

* Press Enter

* Press Enter again for each member to confirm deletion

* Optionally, enter REFRESH on the command line to display member list

'''
Note: there is a similar recipe which uses Data Set List Utility (=3.4) instead
'''



 
----------------------------------------------------------------------
   Renaming members A and C in TSOCA03.ES10.OUTDATA to DATA1, DATA3   
----------------------------------------------------------------------

* Enter =3.1 on the command line (from any panel) to open the Library Utility

* Press Enter

* Under ISPF Library, enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    OUTDATA

* Press Enter

* Enter R next to members A and C

* Press Enter

* Tab to New Name (in the Member Rename pane) and enter DATA1
  (Old Name should be pre-filled wth A for you)

* Press Enter

* Similarly to renaming the A member, tab to New Name and enter DATA3 to rename the C member

* Press Enter

* Optionally, enter REFRESH on the command line to display the new member names

'''
Note: there is a similar recipe which uses Data Set List Utility (=3.4)
'''



---------------------------------------------------------------------------
   Moving members A and C in TSOCA03.ES10.INDATA to TSOCA03.ES10.OUTDATA   
---------------------------------------------------------------------------

* Enter =3.1 on the command line (from any panel) to open the Library Utility

* Press Enter

* Under ISPF Library, enter the following fields:
	- Project: TSOCA03
	- Group:   ES10
	- Type:    INDATA

* Press Enter

* Enter M next to members A and C

* Press Enter

* Tab to Type under "To Library" and change INDATA to OUTDATA

* Press Enter

Recipes for Performing Basic Dataset Manipulations using the tools provided in ISPF
This page was last updated on April 05, 2025
No comments have been posted so far
Leave a Comment