Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 29
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: 128
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: 29
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: 10292
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: 128
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: 29
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: 1846
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: 546
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: 155
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: 128
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: 656
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: 155
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: 128
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: 10292
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
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Default Message in Rexx cvnlynn CLIST & REXX 9 Wed Aug 02, 2017 12:38 am
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us