merge the two files

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
murari83.ds
Participant
Posts: 9
Joined: Sun Aug 19, 2007 11:44 pm

merge the two files

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

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
murari83
Participant
Posts: 14
Joined: Tue Sep 25, 2007 4:05 am

Re: merge the two files

Post 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
m.ramakrishna
Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Re: merge the two files

Post 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?
mcs_dineshm
Participant
Posts: 12
Joined: Sun Sep 23, 2007 12:21 am
Location: chennai

Post 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.
dineshm
murari83
Participant
Posts: 14
Joined: Tue Sep 25, 2007 4:05 am

Re: merge the two files

Post 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
m.ramakrishna
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post 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.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
murari83
Participant
Posts: 14
Joined: Tue Sep 25, 2007 4:05 am

Re: merge the two files

Post by murari83 »

yes,

ENO ascending and SAL Decending,meand


first eno records to Sal last record






thanks
m.ramakrishna
sanath1234
Participant
Posts: 24
Joined: Wed Oct 17, 2007 1:28 am
Location: hyderabad

Re: merge the two files

Post 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
ETL=DS
sanath1234
Participant
Posts: 24
Joined: Wed Oct 17, 2007 1:28 am
Location: hyderabad

Re: merge the two files

Post 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]
ETL=DS
vikasjawa
Participant
Posts: 13
Joined: Tue Aug 29, 2006 3:20 am
Location: Gurgaon

Re: merge the two files

Post 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.
Vikas Jawa
Post Reply