View previous topic :: View next topic
|
Author |
Message |
V S Amarendra Reddy
Active User
Joined: 13 Sep 2006 Posts: 216 Location: USA
|
|
|
|
Hi,
I am using below rexx piece of code to get the current generation of a GDG.
BPXWDYN("ALLOC DSN('"gdg"') SHR REUSE",
"RTDSN(thedsn)")
'thedsn' should have the fully qualified GDG along with the corresponding generation.
I did the below experiment which is not returning proper result.
1.The current generation of my gdg is '1'. When I executed that piece of code it is successfully retrieving the gdg.g0001v00.
2.Now executed a batch job that creates a new generation of the above GDG. The job ended successfully. so now the current generation is g0002v00.
3. Now I have executed the above code, but it is returning g0001v00. I have logged of my complete TSO session and relogged in. Then it is working properly.
Can someone please correct me if I am doing something wrong? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Realize that a TSO session is effectively a job. Then you will see that what is happening is entirely expected. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
This is from a similar topic and does work:
don.leahy wrote: |
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).
Code: |
do 5
x = BPXWDYN("ALLOC DD(XXX) DA('xxxx.aaaaaa.testGDG(+1)') " ,
"NEW SPACE(1,1) RECFM(F,B) LRECL(80) DSORG(PS) CATALOG REUSE" ,
"GDGNT")
end |
This fragment will create 5 generations of XXXX.AAAAAA.TESTGDG |
|
|
Back to top |
|
|
|