The COMPRESS command compresses partitioned data sets on a specified volume. Compressing (degassing) removes unused space between members in a partitioned data set. Depending on the filtering criteria you specify, you can compress either all or some of the partitioned data sets. This command is useful for compressing system partitioned data sets before you apply maintenance (thus avoiding certain space-related abends).
Note: You must not compress the data sets that contain DFSMSdss or IEBCOPY executable code.
The actual PDS compression is done on the existing volume using the IEBCOPY utility. To prevent loss of data if the system or IEBCOPY
abnormally ends during the processing, back up volumes or data sets that meet the filtering criteria before using the COMPRESS Command.
The COMPRESS command cannot process partitioned data sets that:
o Are unmovable
o Have no directory
The following example compresses a selected partitioned data set.
Code:
//JOB1 JOB <ACC INFO>,REGION=nnnnK
//STEP1 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
COMPRESS -
DYNAM(338000) /* DYNAM ALLOC VOL 338000 */ -
EXCLUDE(SYS1.**) /* EXCL 'SYS1....' DATA SETS */ -
/* IF THEY MEET THIS CRITERION */ -
BY((DSCHA EQ 0)) /* DATA SET WAS BACKED UP */
/*
Compress partitioned data sets on volume 338000 if:
o They are not system data sets (EXCLUDE(SYS1.**)), and
o They have not been updated (DSCHA EQ 0) since the last time they were backed up (dumped). This ensures that the data set can be recovered if the system fails while the compress operation is running.
Hope this peice of information might help you in some extent.