Tags

,

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.

Important SQL CODES and ABEND CODES
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
KNOW YOUR MAINFRAME
REXX – INITIAL SETUP
IDCAMS – Define VSAM ESDS
IDCAMS – Define VSAM RRDS
IDCAMS – Define VSAM KSDS
IDCAMS – Define Alternate Index (AIX)
IDCAMS – Define PATH for Alternate Index
IDCAMS – Define GDG
IDCAMS – Alter GDG, VSAM or PS File
IDCAMS – Delete GDG, VSAM or PS File
IDCAMS – Print VSAM File
IDCAMS
Recovery of Deleted Tape data set (Using Volume Serial)
JCL – SYSIN CONCATENATION
JCL – RUN ONLY ONE MIDDLE STEP (RESTART)
GDG – Delete Just Versions Not BASE
JCL – COPY DCB OF INPUT FILE TO OUTPUT FILE
HOW TO SUBMIT A JOB AUTOMATICALLY AFTER A JOB FINISHES
DELETE ALL GDG VERSIONS WITHOUT DELETING BASE
LISTCAT – BATCH JOB
IEBCOPY Examples
IEBGENER – INTERNAL READER TO SUBMIT
Delete Multiple datasets with same HLQ
JCL INTERVIEW QUESTIONS
JCL TIPS
Advertisements