Problem Concatenation
Moderators: chulett, rschirm, roy
Problem Concatenation
I want to concatene 2 Sequential File in one Sequential File. Is it possible ?
When I test it, I have just DATA of one sequential file but not of the two. The structure is always the same (just one columns).
When I test it, I have just DATA of one sequential file but not of the two. The structure is always the same (just one columns).
How are you doing the 'concatenation'? Hopefully, not with two output links both trying to write to the same sequential file at the same time. That simply cannot be done.
Write to two different sequential files and then (in the After Job arena) either concatenate one onto the end of the other or the two together into a new file. A simple shell script can do this or you can issue the commands directly using ExecSH after job.
Write to two different sequential files and then (in the After Job arena) either concatenate one onto the end of the other or the two together into a new file. A simple shell script can do this or you can issue the commands directly using ExecSH after job.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Only if two jobs or steps are involved!denzilsyb wrote:In the sequential file stage, use the 'Append' option, instead of the overwrite option.
Yes, a second file can be appended to the end of an existing file, but people that haven't faced this issue before shouldn't think they can do this all at once.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
About this, i have my first row in differents files which is the name of columns. When I concatene all this files with a unique columns, I don't know how to keep only one time the first row in the final file. I obtain several times the row with column names. My idea is to extract in a file only the first row, can i do that ?
It works just fine... as long as it is the only process writing to the file.
If you are building these two outputs simultaneously, then you must write them to two distinct filenames. After the job completes you can combine them however you please.
If you are building these two outputs simultaneously, then you must write them to two distinct filenames. After the job completes you can combine them however you please.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Depending on what you want to do, it may be sufficient to write to two files, then use the cat command to append the second to the first.
On the other hand, if you want to append columns from one file to each row in the first file, then what you need is the Merge stage. The Merge stage performs various kinds of join between text files.
On the other hand, if you want to append columns from one file to each row in the first file, then what you need is the Merge stage. The Merge stage performs various kinds of join between text files.
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.