Copying all the generations of a gdg to another file will copy the data from last gen. to 1st gen. of the GDG.
Now my requirement is, I have to copy the GDG versions in the order of their creation. i.e.,
Data in m.g0001v00 = 1
Data in m.g0002v00 = 2
Data in m.g0003v00 = 3
An IDCAMS repro to a PS of this GDG base would give me the following output.
But I want to get the output as
Hope my question is clear
Step02 uses sort to write the result of step 1 into two separate files.
SORT is used to write the GDG version names alone to the output files.
THe GDG version names can be found in the above listing after the text
Step03 uses another SORT to merge the contents of the two files T1 and T2 with the SORT IN data, which is a job.
The output of the SORT is routed to the Internal Reader which submits the resulting job.
The output of this final job will give the FIFO data of the GDG versions.
Here is the code below which does exactly what i wanted.