|
Entire document Available as PDF |
Table of Contents
This chapter explains how to delete an entire PDS or individual members. It also explains how to rename an entire PDS or individual member, and how to assign an alias to a member.
The easiest way to accomplish either of these tasks is to submit an OS/390 batch job to execute TSO via batch and use the TSO commands DELETE or RENAME. You can also sign on to TSO and use these commands
interactively from the TSO READY prompt.
You use the DELETE command to get rid of an individual member within a PDS (retaining the PDS and other members) or to delete the entire data set.
Use the following form of the DELETE command to delete an individual member:
DELETE 'data.set.name(member)'
For example, to delete a member named PHOTON in a PDS named UF.ENTERPRS.WEAPONS, you would use:
DELETE 'UF.ENTERPRS.WEAPONS(PHOTON)'
To delete the entire data set, just specify the data set name on the DELETE command, as in the following example.
DELETE 'data.set.name'
The sample batch job in Figure 1 shows how to use the TSO DELETE command to 1) delete a specific member (ROSES) in the PDS named UF.GARDEN.FLOWERS; and 2) to delete the entire PDS named UF.GARDEN.WEEDS.
Figure 8. How to Use the DELETE Command.
//jobnameJOB (,,time,lines),'your name',CLASS=class/*ROUTE PRINTnode.location// EXEC TSO DELETE 'UF.GARDEN.FLOWERS(ROSES)' DELETE 'UF.GARDEN.WEEDS' /*
The first delete command will retain the data set and all members, except ROSES, which will be deleted. The second example will delete the entire PDS.
You can use the RENAME command both to rename an entire data set and to rename an individual member. You can also use it to create an ALIAS for a member.
To rename an entire PDS, use the following form:
RENAME 'old.name' 'new.name'
To rename an individual member, use:
RENAME 'pds.name(oldname)' 'pds.name(newname)'
This form of the RENAME command retains the original PDS name and just renames the specified member.
To create an alias for a member, use:
RENAME 'pds.name(oldname)' 'pds.name(newname)' ALIAS
The ALIAS option specifies that "newname" is to be an alias, rather than a replacement.
The sample job in Figure 2 shows how to use the RENAME command to rename an entire PDS, rename an individual member from ROSES to TULIPS, and create an alias.
Figure 9. How to Use the RENAME Command.
//jobnameJOB (,,time,lines),'your name',CLASS=class/*ROUTE PRINTnode.location// EXEC TSO RENAME 'UF.GARDEN.SEEDS' 'UF.GARDEN.BULBS' RENAME 'UF.GARDEN.FLOWERS(ROSES)' 'UF.GARDEN.FLOWERS(TULIPS)' RENAME 'UF.GARDEN.TREES(PINES)' 'UF.GARDEN.TREES(NEEDLES)' ALIAS /*
The first example renames the entire data set. The second example changes the name of member ROSES to TULIPS. The third example creates an alias called NEEDLES for member PINES.