|
Entire document Available as PDF |
Sometimes a PDS has to be copied and reallocated. You would need to do so, for example, if your data set has run out of directory space. You cannot enlarge the directory of an existing PDS. You can, however, reallocate it with a bigger directory. You can also reallocate a PDS to empty it and reuse it.
There are many ways to accomplish this, but you can do it by following these simple steps:
First, use CREATLIB to create a new PDS. Make sure you give this PDS a unique data set name. Use the DIR= keyword in CREATLIB to raise or lower the number of directory blocks.
Second,
If your goal is to create an empty PDS with the same name as an existing one, delete your original PDS (this assumes you don't wish to keep the data it contained) and then rename your new one to the old name.
To retain the information in your old PDS, copy it to the new PDS, delete the old PDS, then rename the new one to the old name.
See Chapter 2 in this document on how to create a new PDS. The sample JCL in Figure 1 shows how to copy the contents of one PDS into another.
Figure 7. How to Copy a PDS.
//jobnameJOB (,,time,lines),'your name',CLASS=class,REGION=2M /*ROUTE PRINTnode.location// EXEC CREATLIB,... // EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=A //SYSUT1 DD DSN=old.dataset.name,DISP=SHR //SYSUT2 DD DSN=new.dataset.name,DISP=OLD /*
IEBCOPY is an IBM utility for copying partitioned data sets. It is documented in the MVS/DFP Utilities manual.
If you want to delete the old PDS, use the DELETE command described in Chapter 6, How to Delete or Rename a PDS. We recommend that you do NOT use this command in the same job as the
copy process in case the copy process is not successful for some reason. If the copy process fails, you could inadvertently delete your data set before you copy it.
If you want the new data set to have the same name as the old data set, use the RENAME command, also described in Chapter 6.