Merge columns from 2 seq. files with different metadata.

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
Shailendra
Participant
Posts: 40
Joined: Tue Nov 15, 2005 11:53 pm

Merge columns from 2 seq. files with different metadata.

Post 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
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post 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
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
anil kumar
Participant
Posts: 8
Joined: Sat Jun 25, 2005 8:03 am
Location: bangalore

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

Post 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...
Shailendra
Participant
Posts: 40
Joined: Tue Nov 15, 2005 11:53 pm

Post by Shailendra »

Thanks Guys,

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

Regards
Shailendra
Post Reply