Hi,
I'm not sure of what platform you are running this on, but if you are using mainframe Z/OS, you might consider having one subtreatment in a generational file and then at the end in a separate JCL step, you might concatenate the gdgs into one dataset through a SyncSort - Copy option and you will have all subtreatments combined to one master dataset.
The individual generations will be pointing to sub-treatments and the output of the SyncSort copy will hold the master data that includes all subtreatments.
If you are running in a Unix platform, you might use a concatenation utility to do what Syncsort does on the mainframe.
Hope this helps...!!!
... View more