My job is creating four individual sequential files of the same structure. I want to append data in to the same seq file, instead of using four files. I have tried ExecSh with touch command with a sample job of two seq files and loading into the same seq file. For first time execution target seq file has only records from source seq file1, for next run target file has data from both source files 1 and 2. Some thing wrong i guess. please send me if any one of you has routine to create/delete a sequential file.
Thanks,
Appending data to the same Sequential file
Moderators: chulett, rschirm, roy
You cannot have multiple processes writing to the same sequential file, period. There's nothing that can be done about this because it's a block writing issue on all operating systems. You have a few choices: if all streams are in one job use a link collector; if separate jobs use a hash file to collect the data using a unique meaningless key to prevent row collisions; else use four separate sequential files and cat them into one and remove the quarter sized original files.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Sage advice.
You can cat the remaining three to the first, and make the rm command conditional on success of the cat command, using ordinary shell operators, for example
The same can be done on Windows, use type instead of cat and del instead of rm.
(you can use wildcards with del, but not multiple file names; there's also a variant of copy that you could use)
You can cat the remaining three to the first, and make the rm command conditional on success of the cat command, using ordinary shell operators, for example
Code: Select all
cat file2 file3 file4 >> file1 && rm -f file2 file3 file4
Code: Select all
type file2 file3 file4 >> file1 && del /Q file2 && del /Q file3 && del /Q file4
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.