IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Rexx to list generations of GDGs and limit


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kX34pZ

New User


Joined: 04 Jan 2022
Posts: 1
Location: India

PostPosted: Tue Jan 04, 2022 1:55 pm
Reply with quote

Hello

I need help in creating a Rexx program. I am working in a migration project. After we have successfully migrated to new region we need to delete older generations of gdgs present in old region and keep only latest 7 generations.

I have a PS file which has list of 1GDG base eg MY.GDG.TEST. Its limit is 10 and has 10gens
I want to take this PS as input to get the limit of GDG and then create an output file which will have list of latest 3 generations ignoring the latest 7 gens.

So wrt to limit, the output will change for each gdg file.
Required output

MY.GDG.TEST.G1
MY.GDG.TEST.G2
MY.GDG.TEST.G3



With the above output file i can feed it in jcl to delete the generations.

Thanks in advance.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Tue Jan 04, 2022 3:10 pm
Reply with quote

where are you facing probles, the logic or the coding ?
also what is your rexx skill level ?

show a sample of the input and output files
( USING THE CODE TAGS )
as
Code:
( USING THE CODE TAGS )
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 907
Location: Bamberg, Germany

PostPosted: Tue Jan 04, 2022 5:17 pm
Reply with quote

Some SORT product can easily help to do the required task. Please show your input DSN.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 628
Location: Denmark

PostPosted: Tue Jan 04, 2022 6:18 pm
Reply with quote

I'll leave it to you to read the dataset, the extraction can be done thus:

Code:
 zz=outtrap('lst.')                 
 "listc ent('gdg.name')"             
 zz=outtrap('off.')                 
 i=3                                 
 do n=-1+lst.0 to 1 by -2 until i=0 
   say lst.n                         
   dsn.i=lst.n                       
   i=i-1                             
 end                                 
 /* list is now in dsn.1 - 3 */
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Access library name in REXX CLIST & REXX 6
No new posts access library name in REXX CLIST & REXX 2
No new posts Receiving RC 5 when executing REXX pr... CLIST & REXX 3
No new posts list pds members name starting with xyz CLIST & REXX 11
No new posts Calling IEHPROGM from REXX CLIST & REXX 7
Search our Forums:

Back to Top