Hi,
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.,
Example:
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.
3
2
1
But I want to get the output as
1
2
3
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
Code:
NONVSAM ----
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.
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
Firstly, well done for showing some initiative and posting your solution. If only all posters would do the same.
As I suggested, knowing that the number of generations would not change, the solution I showed would work.
The other solution I would have offered would have been by using REXX, where you could have initiated the IDCAMS and created and submitted the JCL all in one step. But once again, well done.