Merge or Logical Thinking

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
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Merge or Logical Thinking

Post by karthi_gana »

All,

I am working on the below requirement.

Table Structure:

Market Model Industry Registration


File 1:
Market Model Ind
MK1 M1 5
MK2 M2 15

File 2:

Market Model Reg
MK1 M1 50
MK2 M2 150


I have to merge tthese 2 files and store it in the above table.

I have tried merge and just got 0 in the Industry column.

Expected Output:

MK1 M1 5 50
MK2 M2 15 150

is Merge stage is the right option for this?

Inputs are welcome!
Karthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Looks more like a join to me.
-craig

"You can never have too many knives" -- Logan Nine Fingers
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

Sorry...the file is in the below format.

Market Model Ind Reg
MK1 M1 5 0
MK2 M2 15 0
MK1 M1 0 50
MK2 M2 0 150
Karthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That is a completely different scenario than your original post.
-craig

"You can never have too many knives" -- Logan Nine Fingers
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

yes.. But this is what my requirement...
Karthik
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

Actually we receive 2 files as I said in my first post...But the transpose logic will transpose the file (including some other logics) and give the result which I mentioned in my second post...
Karthik
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's still a join. Between source and join generate a column that identifies the source. Perform the join. Downstream of the join use a Transformer stage to generate two output links, and bring those together using a Funnel stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

ray.wurlod wrote: Between source and join generate a column that identifies the source.
I am not clear on this point. Can you explain little bit more?
Karthik
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Generate a constant that identifies one source as "A" and the other as "B". This will be used downstream to indicate which output column to populate in the Transformer stage.

A Column Generator stage would be ideal for this purpose.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply