Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
This is from a similar topic and does work:
I know this is an old topic, but I did a search for the GDGNT keyword and didn't find anything. So, here is my 2 cents:
An easy way around this is to add the "GDGNT" parameter to the ALLOC statement. This causes BPXWYDN to scan for the latest generation of the data set before determining the generation associated with (+1).
x = BPXWDYN("ALLOC DD(XXX) DA('xxxx.aaaaaa.testGDG(+1)') " ,
"NEW SPACE(1,1) RECFM(F,B) LRECL(80) DSORG(PS) CATALOG REUSE" ,
This fragment will create 5 generations of XXXX.AAAAAA.TESTGDG