In this topic, we described about the Compressing a PDS with detailed example.
A PDS will contain unused areas where a deleted member or the old version of an updated member resided. The above unused space is only reclaimed when a PDS is copied to a new data set, or after a compress-in-place operation successfully completes.
The compress-in-place operation is to specify the same ddname for both the OUTDD and INDD parameters of a COPY statement, without specifying the SELECT / EXCLUDE statement.
Compress is actually performed when both the input and output is the same data set on the same volume. The compress operation is performed in the same relative order as the ddnames in the INDD list.
A PDS can be destroyed if IEBCOPY is interrupted during processing. Do not compress a PDS currently being used by more than one user.
The input file and output file are the same, so this is a batch compress
//COMPRESS EXEC PGM=IEBCOPY //INPUT01 DD DSNAME=input.dataset,DISP=OLD //INPUT02 DD DSNAME=input.dataset,DISP=OLD //SYSIN DD * COPY OUTDD=B,INDD=A /*
Let’s discuss the example in detail.
- INPU01 DD defines a PDS that resides on a disk volume and is assumed to have 700 members.
- INPUT02 DD defines the above PDS as an input.
- SYSIN DD defines the control data set. Because SYSIN all members of the INPUT01 are reorganized and memory will be recovered from unused areas.