My first thought is why use a gdg at all in this situation? Wouldn't a plain data set work just as well. Second is GDG's (relative and absolute) are updated at the END of the job, NOT the end of each step (as best I remember). Relative (0) will be G0001 throughout the job, so (+1) will be G0002 no matter what. else happens. If you Try to alloc ANOTHER (+1) it will tell you G0002 already exists. You have to alloc (+2) to get to G0003
From: Fred Kaptein <fred.kapt...@hp.com> To: IBM-MAIN@bama.ua.edu Date: 01/18/2011 09:40 AM Subject: GDG Question Sent by: IBM Mainframe Discussion List <IBM-MAIN@bama.ua.edu> Hello, I have a question on GDGs We have a GDG data set GDG.DSNAME.G0001V00 and append data into this data set throughout the day. We then run a batch job where we do the following: 1. Read GDG.DSNAME(0) 2. Delete GDG.DSNAME(0) as follows //DELETE EXEC PGM=IEFBR14 //DD1 DD DSN=GDG.DSNAME(0), // DISP=(OLD,DELETE,DELETE) 3. Allocate a new GDG.DSNAME(+1) as follows: //ALLOC EXEC PGM=IEFBR14,COND=(4,LE) //DD1 DD DSN=ISM.SMF.ZHAD011(+1), // DISP=(NEW,CATLG,DELETE),UNIT=3390, // SPACE=(CYL,(50,50)) The ALLOC step actually allocates GDG dataset GDG.DSNAME.G0002V00 Besides changing SMS or running two batch jobs, is there any way to completely delete GDG.DSNAME(0) and allocate GDG.DSNAME(+1) where GDG.DSNAME(+1) will remain with the name GDG.DSNAME.G0001V00 ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html