View previous topic :: View next topic
|
Author |
Message |
cvnlynn
New User
Joined: 14 Jun 2017 Posts: 31 Location: US
|
|
|
|
Hi,
please tell me how to code a variable to refer to latest GDG file (ie ...G022V00) in Rexx. My Rexx exec submits the skeleton that have GDG file. Thanks. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2145 Location: USA
|
|
|
|
1) No-one except yourself would be able to understand your requirements as described.
2) At this forum people usually help others in solving the encountered problems, but not in doing your job from scratch instead of you.
First of all: try to do something yourself, and then show us what exactly is not working properly? At least demonstrate the code itself: where you need to incorporate the GDG version? |
|
Back to top |
|
|
cvnlynn
New User
Joined: 14 Jun 2017 Posts: 31 Location: US
|
|
|
|
Code: |
DSNAME1 = TRANSLATE(,
ENVPREF || '.' ||,
ENVSYST1 || '.' ||,
ENVPROG1 || '.' ||,
ENVIRON || '.' ||,
'FR8DET' || '.' ||,
|
I used TRANSLATE to setup the dataset name, how do I code for the last part of the dataset name which is GDG version (ie GxxxV00). Thanks. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
BPXWDYN invoked with the proper parameters will return the REALNAME of a gdg generation
casually the snippet posted returns the real name for generation 0
BPXWDYN can/will return the real name of ane generation number
Code: |
****** ***************************** Top of Data ******************************
- - - - - - - - - - - - - - - - - - - <some> Line(s) not Displayed
000008 /* Rexx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000009 Trace "O"
000010 ddn = "DDN"
000011 gdg = "ENRICO.TEST.GDG"
000012 gen = "0"
000013 rtrc = BPXWDYN("ALLOC FI(DDN) DA('ENRICO.TEST.GDG("gen")')" ,
000014 " SHR REUSE RTDSN(RTDSN) ")
000015
000016 say "myrc " RTRC
000017 say "realname" RTDSN
000018 exit
- - - - - - - - - - - - - - - - - - - <some> Line(s) not Displayed
****** **************************** Bottom of Data ****************************
|
the result
Code: |
********************************* TOP OF DATA **********************************
myrc 0
realname ENRICO.TEST.GDG.G0003V00
******************************** BOTTOM OF DATA ********************************
|
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2145 Location: USA
|
|
Back to top |
|
|
cvnlynn
New User
Joined: 14 Jun 2017 Posts: 31 Location: US
|
|
|
|
Thanks everyone. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
And you have not come back about some of your other queries - are they resolved, if so how? |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Unless you really know what you're doing, you're better off staying away from GDGs in the TSO (or FTP server, for that matter) environment.
Prime example: Mr. Sorichetti's example. It's fine, as far as it goes. But: once the BPXWDYN goes through, the TSO session effectively "owns" the GDG base: no other job or TSO session can use it until the TSO session terminates. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Quote: |
once the BPXWDYN goes through, the TSO session effectively "owns" the GDG base: no other job or TSO session can use it until the TSO session terminates. |
is not quite accurate. The limitation seems to be that you cannot create a new generation till the allocation is FREEd. You don't have to logoff.
You can use BPXWDYN to obtain the latest generation like this:
Code: |
cc=bpxwdyn('alloc dd(gdg0) da(z.test.gdg(0)) shr reuse')
cc=bpxwdyn('info dd(gdg0) inrtdsn(ds)')
cc=bpxwdyn('free dd(gdg0)')
lq=substr(ds,lastpos('.',ds)+1)
say lq |
However, the OP says that he is submitting a skeleton, which I take to mean JCL, so I wonder why he isn't just using the relative generation in the datasetname in the JCL like DS.NAME(0) ? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2145 Location: USA
|
|
|
|
The original question was "how to get the latest GDG DSNAME" (out of those already existed by that time!).
Besides of the problem with ENQueuing DSNAME, the BPXWDYN solution will allocate the new version of GDG. It's not clear from the topic starter: is that what is needed?
For instance, if we inquired about the latest GDG via BPXWDYN 100 times then we would loose all previously prepared GDG datasets, and create 100 empty datasets instead! |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
steve-myers wrote: |
Unless you really know what you're doing, you're better off staying away from GDGs in the TSO (or FTP server, for that matter) environment.
Prime example: Mr. Sorichetti's example. It's fine, as far as it goes. But: once the BPXWDYN goes through, the TSO session effectively "owns" the GDG base: no other job or TSO session can use it until the TSO session terminates. |
Unless you use the GDGNT parameter. See ibmmainframes.com/viewtopic.php?t=24474&start=0&postdays=0&postorder=asc&highlight=gdgnt |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Quote: |
if we inquired about the latest GDG via BPXWDYN 100 times then we would loose all previously prepared GDG datasets, and create 100 empty datasets instead |
I beg to differ. BPXWDYN INFO will not create a new dataset. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2145 Location: USA
|
|
|
|
Willy Jensen wrote: |
Quote: |
if we inquired about the latest GDG via BPXWDYN 100 times then we would loose all previously prepared GDG datasets, and create 100 empty datasets instead |
I beg to differ. BPXWDYN INFO will not create a new dataset. |
All previous recommendations only suggested to BPXWDYN ALLOCATE the new DSN... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
topic locked
the TS posted
the posts after that one are just a waste of resources |
|
Back to top |
|
|
|