Get the gdg name of a Dataset



IBM's Command List programming language & Restructured Extended Executor

Get the gdg name of a Dataset

Postby samurai » Fri Feb 20, 2015 1:21 am

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!
samurai
 
Posts: 30
Joined: Tue Mar 18, 2014 3:29 pm
Has thanked: 6 times
Been thanked: 0 time

Re: Get the gdg name of a Dataset

Postby enrico-sorichetti » Fri Feb 20, 2015 5:12 am

search the forum using as search keyword BPXWDYN
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3002
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Get the gdg name of a Dataset

Postby steve-myers » Fri Feb 20, 2015 6:44 am

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Get the gdg name of a Dataset

Postby prino » Fri Feb 20, 2015 12:30 pm

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!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: Get the gdg name of a Dataset

Postby steve-myers » Fri Feb 20, 2015 9:26 pm

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Get the gdg name of a Dataset

Postby Pedro » Sat Feb 21, 2015 2:43 am

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.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Get the gdg name of a Dataset

Postby Mickeydusaor » Sat Feb 21, 2015 3:38 am

you have the base name just issue a listcat for the base name, scan the listcat output and pickup you last gdg version
User avatar
Mickeydusaor
 
Posts: 29
Joined: Fri Feb 24, 2012 11:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Get the gdg name of a Dataset

Postby steve-myers » Sat Feb 21, 2015 7:20 am

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post