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
kjaouhari
Participant
Posts: 325 Joined: Thu Mar 16, 2006 10:22 am
Post
by kjaouhari » Wed Oct 04, 2006 6:01 am
Hello all,
I want to merge 2 files. The first contains Header and second contains the details.
When I compile job, I have an error message : "Link Collector stage must have the same number of columns on all of its input and output..."
So shoud I use an other stage to merge 2 files ?
thanks for your help dsxians !
boppanakrishna
Participant
Posts: 106 Joined: Thu Jul 27, 2006 10:05 pm
Location: Mumbai
Post
by boppanakrishna » Wed Oct 04, 2006 6:07 am
hi,
if you want to use Link Collector or Link Partitioner the metadata must be same in both the input and output files ..
For merging the two files you can use Merge stage,
if you have any queries regarding this you are always welcome
Thanks
Boppana Ramakrishna
ShaneMuir
Premium Member
Posts: 508 Joined: Tue Jun 15, 2004 5:00 am
Location: London
Post
by ShaneMuir » Wed Oct 04, 2006 6:29 am
Can't you just use a unix command in a before or after subroutine?
eg cat detail.txt >> header.txt
kjaouhari
Participant
Posts: 325 Joined: Thu Mar 16, 2006 10:22 am
Post
by kjaouhari » Wed Oct 04, 2006 6:32 am
Thanks for your ideas,
but with your methods I think I can't have a file with this structure:
header 1
ligne 1
ligne 2
header 2
ligne 1
ligne 2
Kirtikumar
Participant
Posts: 437 Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India
Post
by Kirtikumar » Wed Oct 04, 2006 6:49 am
What are contents of input header file and detail file?
To understand the output mentioned in your post, input should be specified.
Regards,
S. Kirtikumar.
kjaouhari
Participant
Posts: 325 Joined: Thu Mar 16, 2006 10:22 am
Post
by kjaouhari » Wed Oct 04, 2006 6:58 am
Header file contains description and details contains amount.
I've found a dirty solution : I use other transformer before link collector to set the same columns number :
NumHeader-NumLigne-Content
ShaneMuir
Premium Member
Posts: 508 Joined: Tue Jun 15, 2004 5:00 am
Location: London
Post
by ShaneMuir » Wed Oct 04, 2006 4:37 pm
kjaouhari wrote: Thanks for your ideas,
but with your methods I think I can't have a file with this structure:
header 1
ligne 1
ligne 2
header 2
ligne 1
ligne 2
Is there any link between the header and the detail? ie So you know which detail lines belong to which header, or is it just write header, 2 detail lines, header, 2 detail lines etc?
kumar_s
Charter Member
Posts: 5245 Joined: Thu Jun 16, 2005 11:00 pm
Post
by kumar_s » Thu Oct 05, 2006 7:26 am
Converting into single large varchar column before Link Colelctor might also help.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'