Page 1 of 1

Get the gdg name of a Dataset

PostPosted: Fri Feb 20, 2015 1:21 am
by samurai
Hi All,

i need to find the latest version of a gdg.

i have stored all the GDG name in a ps, and i need to find the latest version of GDG actually in 3.4(lv) we can find by putting D.S....(0).

input ps :

aaa.xxxx.ccc
sss.xxx.ddd

output ps:

aaa.xxxx.ccc.gv00007
sss.xxx.ddd.gv00008


i tried to read the dataset from PS but it is not showing the latest version if i add (0) behind DS name.. suggest please. Thanks!

Re: Get the gdg name of a Dataset

PostPosted: Fri Feb 20, 2015 5:12 am
by enrico-sorichetti
search the forum using as search keyword BPXWDYN

Re: Get the gdg name of a Dataset

PostPosted: Fri Feb 20, 2015 6:44 am
by steve-myers
The only safe way to access GDG data sets using their relative generation is JCL. Period. End of story.

Using BPXWDYN, even if it accepts the syntax DATASET(gdg(0)) - which I hope it will not - is very dangerous. It can lead to unexpected resolution of the data set name.

Re: Get the gdg name of a Dataset

PostPosted: Fri Feb 20, 2015 12:30 pm
by prino
steve-myers wrote:The only safe way to access GDG data sets using their relative generation is JCL. Period. End of story.

Using BPXWDYN, even if it accepts the syntax DATASET(gdg(0)) - which I hope it will not - is very dangerous. It can lead to unexpected resolution of the data set name.

BPXWDYN accepts relative generation numbers, I've been using it for more than a decade, and have never found it to cause problems. Please explain your statement, I'm really curious!

Re: Get the gdg name of a Dataset

PostPosted: Fri Feb 20, 2015 9:26 pm
by steve-myers
The first time you use a relative generation in an allocation, either JCL or dynamic allocation, you fix the relationship between a relative generation and the absolute generation for the entire job. Since a TSO session is a job in MVS parlance ... You also prevent other jobs from using the GDG until your job or TSO session completes.

Re: Get the gdg name of a Dataset

PostPosted: Sat Feb 21, 2015 2:43 am
by Pedro
The only safe way to access GDG data sets...

and
The first time you use a relative generation in an allocation,...

I think what is being asked for is how to determine the real name. Whereas, Steve is cautioning about accessing the data.

That is, I do not think Prino's and Steve's comments contradict each other.

Re: Get the gdg name of a Dataset

PostPosted: Sat Feb 21, 2015 3:38 am
by Mickeydusaor
you have the base name just issue a listcat for the base name, scan the listcat output and pickup you last gdg version

Re: Get the gdg name of a Dataset

PostPosted: Sat Feb 21, 2015 7:20 am
by steve-myers
Pedro and Mickydusaor are absolutely correct.
listc level(XXXXXX.disklist.sysutx
 NONVSAM ------- XXXXXX.DISKLIST.SYSUTX.G0016V00
      IN-CAT --- CATALOG.XXXXXX.UCAT
 NONVSAM ------- XXXXXX.DISKLIST.SYSUTX.G0017V00
      IN-CAT --- CATALOG.XXXXXX.UCAT
 NONVSAM ------- XXXXXX.DISKLIST.SYSUTX.G0018V00
      IN-CAT --- CATALOG.XXXXXX.UCAT
 NONVSAM ------- XXXXXX.DISKLIST.SYSUTX.G0019V00
      IN-CAT --- CATALOG.XXXXXX.UCAT
Obviously the true name for relative generation 0 in XXXXXX.DISKLIST.SYSUTX is XXXXXX.DISKLIST.SYSUTX.G0019V00. You can do the equivalent in ISPF DSLIST (3.4). I do this fairly often.