I used the PUTENV example to dynamically allocate files and it works fine. However I would like to enhance the program to do the following and would like know if it is possible.
I have a file that has header records for several customers and detail records. However the header and details for the same customer appear at different places in the file. At the present time I do not want to sort the file.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
Is that possible and how could it be done.
It can in assembler. . . Most organizations do not want to increase the amount of assembler code they must maintain. I don't know about PUTENV. Sorry.
You might consider initially reading the file as it is, making a copy of the records needed for your process and sorting those copied records. The originial file would remain as it is and the copy would be in the order needed for your process.
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
If you do not close nor free the file for customer1 and use a different ddname for customer2, you could just write to the customer1 and customer2 files as needed. Otherwise you would need to free the ddname and re-allocate customer1 with disp=mod. This will add a lot of overhead to the process, and I believe that it would save resources to sort the file so that this is not needed.