Page 1 of 1

Merge columns from 2 seq. files with different metadata.

Posted: Tue Feb 28, 2006 6:59 pm
by Shailendra
Hi,

I want to merge 4 columns from 1 sequential file and 1 column from second file.

Eg:

file1
-------
id, name, imp
1, A, 10
2,B, 20

file2
------
Date
20051231( only 1 record)

output
-------

id, name, imp, Date
1, A, 10,20051231
2,B, 20,20051231

1
I tried link collector but both files should have the same # of columns.
I tried merge stage but I dont have a common key in both files.

Please suggest.

Thanks in advance
Shailendra

Posted: Tue Feb 28, 2006 7:19 pm
by rasi
Is there any specific reason you need to use Merge stage. If it is just one value you can store it in a hash file and do a lookup. Or you can write your date value to a sequential file and before running this job read the sequential file and pass the value as parameter

Re: Merge columns from 2 seq. files with different metadata.

Posted: Wed Mar 01, 2006 1:16 am
by anil kumar
Shailendra wrote:Hi,

I want to merge 4 columns from 1 sequential file and 1 column from second file.

Eg:

file1
-------
id, name, imp
1, A, 10
2,B, 20

file2
------
Date
20051231( only 1 record)

output
-------

id, name, imp, Date
1, A, 10,20051231
2,B, 20,20051231

1
I tried link collector but both files should have the same # of columns.
I tried merge stage but I dont have a common key in both files.

Please suggest.

Thanks in advance
Shailendra
HI
if that date is the only value to be merged with then you can directly create the column and assign the value in the transformer stage .No need to merge also...
or you can create one "dummy" column in output columns of both the input stages and give a default value of 1 to both...then you can merge both the seq files based on this dummy column.
hope this will work...

Posted: Wed Mar 01, 2006 12:46 pm
by Shailendra
Thanks Guys,

I used the Dummy column approach and used a hask to lookup. It worked.

Regards
Shailendra