GDG – Delete Just Versions Not BASE
There is a GDG file with 3 versions. Requirement is to just delete the versions and not the BASE. Which of the below can be used.
A) //PGM EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (YOUR.INPUT.GDG) GDG
B) //PGM EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (YOUR.INPUT.GDG) GDG FORCE
C) //PGM EXEC PGM=IEFBR14
//YOURGDG DD DSN=YOUR.INPUT.GDG,
// DISP=(OLD,DELETE,DELETE)
D) TSO DEL ‘YOUR.INPUT.GDG’
A. C
Please note that without FORCE command as used in OPTION B, we cannot delete a GDG BASE when you have some versions for it.
So we can not directly delete the GDG base when you have versions on it as in our case.
Let us see below about all the options.
A) Job will give a return code of “08” – because the job tries to delete the GDG and not the versions.
B) Job will delete the BASE as well along with versions
C) Job will delete only the versions
D) This TSO function as well will give an error message, because it also tries to delete the GDG and not the versions.
——————————————————————————————————–
In United States, If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog
——————————————————————————————————–
You may also like to look at: