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: 10872
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

Senior Member


Joined: 15 Aug 2015
Posts: 1231
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: 712
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 Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top