|
| 1 | +# DeletePDS Utility |
| 2 | + |
| 3 | +The DeletePDS utility is used to delete PDSes on z/OS that are no longer needed. |
| 4 | +Typically, after a build in a feature branch where datasets were created for the build, clean-up should occur to limit and optimize the required storage space on z/OS. |
| 5 | + |
| 6 | +To delete datasets with the DeletePDS utility, you would need to specify the parameter `-h`/`--hlq` to indicate the High-Level Qualifier for your datasets to be deleted. This value is used as a filter expression for identifying the datasets to be deleted. |
| 7 | + |
| 8 | +An other parameter `-p`/`--preview` is helpful to verify which datasets are to be deleted. Using this parameter will just display the datasets that matches the filter expression passed in the HLQ parameter of the script. |
| 9 | + |
| 10 | + |
| 11 | +Preview: |
| 12 | +``` |
| 13 | +$DBB_HOME/bin/groovyz DeletePDS.groovy -p -h BUILD.CATMAN.DEV |
| 14 | +``` |
| 15 | +Output: |
| 16 | +``` |
| 17 | +** Searching for all the datasets filtered with HLQ 'BUILD.CATMAN.DEV' |
| 18 | +*** Found 'BUILD.CATMAN.DEV.ASM' |
| 19 | +*** Found 'BUILD.CATMAN.DEV.BMS' |
| 20 | +*** Found 'BUILD.CATMAN.DEV.BMS.COPY' |
| 21 | +*** Found 'BUILD.CATMAN.DEV.BZU.BZUCFG' |
| 22 | +*** Found 'BUILD.CATMAN.DEV.BZU.BZUPLAY' |
| 23 | +*** Found 'BUILD.CATMAN.DEV.BZU.BZURPT' |
| 24 | +*** Found 'BUILD.CATMAN.DEV.COBOL' |
| 25 | +*** Found 'BUILD.CATMAN.DEV.COPY' |
| 26 | +*** Found 'BUILD.CATMAN.DEV.DBRM' |
| 27 | +*** Found 'BUILD.CATMAN.DEV.LOAD' |
| 28 | +*** Found 'BUILD.CATMAN.DEV.MACRO' |
| 29 | +*** Found 'BUILD.CATMAN.DEV.OBJ' |
| 30 | +*** Found 'BUILD.CATMAN.DEV.TEST.COBOL' |
| 31 | +*** Found 'BUILD.CATMAN.DEV.TEST.LOAD' |
| 32 | +** Found 14 entries. |
| 33 | +** Build finished |
| 34 | +``` |
| 35 | + |
| 36 | +Deletion: |
| 37 | +``` |
| 38 | +$DBB_HOME/bin/groovyz DeletePDS.groovy -h BUILD.CATMAN.DEV |
| 39 | +``` |
| 40 | +Output: |
| 41 | +``` |
| 42 | +** Deleting all datasets filtered with HLQ 'BUILD.CATMAN.DEV' |
| 43 | +*** Deleting 'BUILD.CATMAN.DEV.ASM' |
| 44 | +*** Deleting 'BUILD.CATMAN.DEV.BMS' |
| 45 | +*** Deleting 'BUILD.CATMAN.DEV.BMS.COPY' |
| 46 | +*** Deleting 'BUILD.CATMAN.DEV.BZU.BZUCFG' |
| 47 | +*** Deleting 'BUILD.CATMAN.DEV.BZU.BZUPLAY' |
| 48 | +*** Deleting 'BUILD.CATMAN.DEV.BZU.BZURPT' |
| 49 | +*** Deleting 'BUILD.CATMAN.DEV.COBOL' |
| 50 | +*** Deleting 'BUILD.CATMAN.DEV.COPY' |
| 51 | +*** Deleting 'BUILD.CATMAN.DEV.DBRM' |
| 52 | +*** Deleting 'BUILD.CATMAN.DEV.LOAD' |
| 53 | +*** Deleting 'BUILD.CATMAN.DEV.MACRO' |
| 54 | +*** Deleting 'BUILD.CATMAN.DEV.OBJ' |
| 55 | +*** Deleting 'BUILD.CATMAN.DEV.TEST.COBOL' |
| 56 | +*** Deleting 'BUILD.CATMAN.DEV.TEST.LOAD' |
| 57 | +** Deleted 14 entries. |
| 58 | +** Build finished |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +### DeletePDS.groovy Command Line Options |
| 64 | +``` |
| 65 | +usage: DeletePDS.groovy [options] |
| 66 | +options: |
| 67 | + -h,--hlq <arg> High-Level Qualifier of datasets to delete |
| 68 | + -p,--preview Only lists the datasets without actually deleting them |
| 69 | +``` |
0 commit comments