View previous topic :: View next topic
|
Author |
Message |
kX34pZ
New User
Joined: 04 Jan 2022 Posts: 1 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Some SORT product can easily help to do the required task. Please show your input DSN. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
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 |
|
|
|