Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to code for GDG in Rexx

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
cvnlynn

New User


Joined: 14 Jun 2017
Posts: 31
Location: US

PostPosted: Wed Aug 09, 2017 9:13 pm    Post subject: how to code for GDG in Rexx
Reply with quote

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
View user's profile Send private message

sergeyken

Active User


Joined: 29 Apr 2008
Posts: 229
Location: Maryland

PostPosted: Wed Aug 09, 2017 10:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
cvnlynn

New User


Joined: 14 Jun 2017
Posts: 31
Location: US

PostPosted: Wed Aug 09, 2017 10:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Wed Aug 09, 2017 10:51 pm    Post subject: Reply to: how to code for GDG in Rexx
Reply with quote

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
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 229
Location: Maryland

PostPosted: Wed Aug 09, 2017 11:09 pm    Post subject:
Reply with quote

There was a similar topic back in 2005
Back to top
View user's profile Send private message
cvnlynn

New User


Joined: 14 Jun 2017
Posts: 31
Location: US

PostPosted: Thu Aug 10, 2017 12:04 am    Post subject:
Reply with quote

Thanks everyone.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1932
Location: UK

PostPosted: Thu Aug 10, 2017 5:42 am    Post subject:
Reply with quote

And you have not come back about some of your other queries - are they resolved, if so how?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 587
Location: The Universe

PostPosted: Thu Aug 10, 2017 8:46 am    Post subject:
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 186
Location: Switzerland

PostPosted: Thu Aug 10, 2017 3:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 229
Location: Maryland

PostPosted: Thu Aug 10, 2017 7:49 pm    Post subject:
Reply with quote

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
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 659
Location: Whitby, ON, Canada

PostPosted: Thu Aug 10, 2017 8:38 pm    Post subject:
Reply with quote

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 http://ibmmainframes.com/viewtopic.php?t=24474&start=0&postdays=0&postorder=asc&highlight=gdgnt
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 186
Location: Switzerland

PostPosted: Fri Aug 11, 2017 12:50 am    Post subject:
Reply with quote

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
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 229
Location: Maryland

PostPosted: Fri Aug 11, 2017 2:02 am    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Fri Aug 11, 2017 2:20 am    Post subject: Reply to: how to code for GDG in Rexx
Reply with quote

topic locked
the TS posted
Quote:
Thanks everyone.


the posts after that one are just a waste of resources
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IBEGENER RETURN CODE 12 anilkumar922 All Other Mainframe Topics 5 Wed Dec 13, 2017 11:41 am
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Finding the plan when code compiled u... Ahemad DB2 1 Fri Dec 01, 2017 6:38 pm
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us