DataStage coulmn merge

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
marcogonnelli
Participant
Posts: 13
Joined: Thu Jun 16, 2005 6:44 am

DataStage coulmn merge

Post by marcogonnelli »

Hi all anyone can help me with this ?
I have 2 sequential files (csv) with this structure...

1) File structure : key_col,colA,colB,colC
2) File structure : key_col,colD,colE

I need to import the records in these files in an Informix table with this structure merging the records with the same key_col values

3) Informix table structure :

key_col,colA,colB,colC,colD,colE

Exmaple :

1) 10,vala,valb,valc
20,vala1,valb1,valc1

2) 10,vald,vale

3) 10,vala,valb,valc,vald,vale
20,vala1,valb1,valc1,<null>,<null>

Is it possible doing that with merge stage or link collector stage ?
ThanX in advance Marco
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You can do that will a lookup itself.
marcogonnelli
Participant
Posts: 13
Joined: Thu Jun 16, 2005 6:44 am

Post by marcogonnelli »

How can I do that ? :roll: :shock:

Thnxx Marco
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

The details of lookup is provided in the docs that come with the software. Try it and if you have any doubts or problems, do let me know.
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Post by pnchowdary »

Hi Marco,

You can use File structure1 as input and the File structure2 as lookup (using hash file)

Read the File structure2 from the source (.csv) file into a hash file
and then use this hash file as a lookup for File structure1 (Input) and if y ou find a match on the Key_col, then transfer all the required columns to the target.

I hope this will get you started.
marcogonnelli
Participant
Posts: 13
Joined: Thu Jun 16, 2005 6:44 am

Post by marcogonnelli »

oh thnxx I'm going to read it carefully in the docs :P
But I have documentation about Lookup stage on help
..but I don't have lookup stage on palette ?!?!? Is it bossible I don't have it installed ???? My DataStage Designer version is 6.0.0.21...
How is it bossible ? :shock:
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Post by pnchowdary »

If you are using Server edition of Datastage, then you wouldnt see a lookup stage. It is only present in the Enterprise/PX edition. When I meant lookup, I meant the hash file stage, which can be used for a lookup in server jobs.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The server job Merge stage performs exactly the function you specified, which is an inner join. Read about it in its own manual (Merge.pdf).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
marcogonnelli
Participant
Posts: 13
Joined: Thu Jun 16, 2005 6:44 am

Post by marcogonnelli »

:? ...but inner join extratcs only rows matching the key (as SQL inner join does)........ I need to have all rows in file A and all rows in file B with columns values merged for same key values as I explained in the example.....
I've seen I don't have Lookup Stage in my version :x I'll try to handle it with HashFile as pnchowdary suggested...
any other suggestion will be appreciated... ThnXX MarK
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You can do an outer join user a merge.

But you need both source for merge in form of a seq file.
Post Reply