Page 1 of 1

merge the two files

Posted: Wed Oct 31, 2007 2:53 am
by murari83.ds
Hi


I hava a two seq files

file1
ENO,ENAME
101,ABC
102,BBB
103,DDD

FILE2
SAL,AGE
50000,45
7000,66
8000,77


Using this data i want to merge the file, i don"t have a key colum.



Thanks

Posted: Wed Oct 31, 2007 3:10 am
by ray.wurlod
Use a Column Generator stage to generate sequential integer keys on each link (outputs from the source files), and use that as the join key.

Re: merge the two files

Posted: Wed Oct 31, 2007 3:43 am
by murari83
[quote="murari83.ds"]Hi


I hava a two seq files

file1
ENO,ENAME
101,ABC
102,BBB
103,DDD

FILE2
SAL,AGE
50000,45
7000,66
8000,77



I sove this problem using this


seqfile1----->surrogatekey---
merge---->seqfile

seqfile2--> surrogate key------


my problem is

i want to target out like this, any posibility

out put

ENO ENAME SAL AGE
101 ABC 8000 77
102 BBB 7000 66
103 DDD 50000 45


thanks

Re: merge the two files

Posted: Wed Oct 31, 2007 3:47 am
by Havoc
murari83 wrote:
murari83.ds wrote:Hi


I hava a two seq files

file1
ENO,ENAME
101,ABC
102,BBB
103,DDD

FILE2
SAL,AGE
50000,45
7000,66
8000,77



I sove this problem using this


seqfile1----->surrogatekey---
merge---->seqfile

seqfile2--> surrogate key------


my problem is

i want to target out like this, any posibility

out put

ENO ENAME SAL AGE
101 ABC 8000 77
102 BBB 7000 66
103 DDD 50000 45


thanks
'any possibility' = cartesian product/join?

Posted: Wed Oct 31, 2007 8:44 am
by mcs_dineshm
Use Two SUrrogate key generator one after each sequential file stage, then use a merge stage and in the merge stage output mapping remove the key that is generated using surrogate key generator. note tat while using surrogate key generator use same name as key for both surrogate key generators.

Re: merge the two files

Posted: Wed Oct 31, 2007 11:06 pm
by murari83
Hi
i want to target out like this, any posibility

out put

ENO ENAME SAL AGE
101 ABC 8000 77
102 BBB 7000 66
103 DDD 50000 45


thanks

Posted: Thu Nov 01, 2007 12:07 am
by jhmckeever
What are your rules for joining the data?

From your example we could infer you are intending to join Ascending ENO on descending SAL - Right?

J.

Re: merge the two files

Posted: Thu Nov 01, 2007 12:31 am
by murari83
yes,

ENO ascending and SAL Decending,meand


first eno records to Sal last record






thanks

Re: merge the two files

Posted: Thu Nov 01, 2007 2:27 am
by sanath1234
murari83.ds wrote:Hi


I hava a two seq files

file1
ENO,ENAME
101,ABC
102,BBB
103,DDD

FILE2
SAL,AGE
50000,45
7000,66
8000,77


Using this data i want to merge the file, i don"t have a key colum.



Thanks

TRY TO USE FUNNEL STAGE

Re: merge the two files

Posted: Thu Nov 01, 2007 2:31 am
by sanath1234
sanath1234 wrote:
murari83.ds wrote:Hi


I hava a two seq files

file1
ENO,ENAME
101,ABC
102,BBB
103,DDD

FILE2
SAL,AGE
50000,45
7000,66
8000,77


Using this data i want to merge the file, i don"t have a key colum.



Thanks

TRY TO USE FUNNEL STAGE//quote]

Re: merge the two files

Posted: Thu Nov 01, 2007 6:36 am
by vikasjawa
Hi,
Sort file1 using ENO and file2 using SAL.Using column generator create a Key column for both these file and then join these.Simply remove the key column in the next stage.