Problem Concatenation

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
besco
Participant
Posts: 33
Joined: Wed Jun 09, 2004 1:44 am

Problem Concatenation

Post by besco »

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).
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
denzilsyb
Participant
Posts: 186
Joined: Mon Sep 22, 2003 7:38 am
Location: South Africa
Contact:

Post by denzilsyb »

In the sequential file stage, use the 'Append' option, instead of the overwrite option.
dnzl
"what the thinker thinks, the prover proves" - Robert Anton Wilson
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

denzilsyb wrote:In the sequential file stage, use the 'Append' option, instead of the overwrite option.
Only if two jobs or steps are involved! :shock:

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
besco
Participant
Posts: 33
Joined: Wed Jun 09, 2004 1:44 am

Post by besco »

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 ?
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

Post by kab123 »

In The Target Seq file, in the inputs tab, default is set to 'over write existing file',you have to select for second seq file as append existing file.
I think this will do.
besco
Participant
Posts: 33
Joined: Wed Jun 09, 2004 1:44 am

Post by besco »

Chullet has rigth. I had already check the append option but it doesn't work.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It works just fine... as long as it is the only process writing to the file. :wink:

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
besco
Participant
Posts: 33
Joined: Wed Jun 09, 2004 1:44 am

Post by besco »

It works now. I just have two Stage "Sequential File", with a bond between the two. Thanks very much for your answers !!
;)
Post Reply