Lookup Condition not correct

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
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Lookup Condition not correct

Post by us1aslam1us »

Hi,

I am doing a simple lookup:

Database
v
v
Dataset>>>>Lookup>>>>>Dataset


In the Database i am having the data as

ID POS DEPT
1 QA FIN
2 QA FIN
3 QA FIN
1 BA DIN
3 BA DIN

and the source is having data like

ID Name1 Name2
1 A AA
2 B BB
3 C CC


The key is ID for lookup.I want only 3 rows in the output like

ID POS1 POS2 Name1
1 QA BA A
2 QA B
3 QA BA C

ANY HELP IS APPRECIATED

THANKS
SAM
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no common key on which a lookup can be based. Please describe the algorithm you would use to generate the output if DataStage were not available.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

ray.wurlod wrote:There is no common key on which a lookup can be based. Please describe the algorithm you would use to generate the output if DataStage were not available.
Hi Ray,

I can do this thing by doing the lookup based on ID and allowing "Multiple rows" through the lookup link.

ID POS Name1
1 QA A
1 BA A
2 QA B
3 QA C
3 BA C

After this i am getting stuck on how to convert this multiple rows into a single row.

Any Help is appreciated
Thanks
sam
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This technique is called a vertical pivot - a search will reveal a few approaches that people have taken to it. It's tricky to do in parallel jobs and retain parallelism.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Hi

Can somebody tell me what this Error means.

Code: Select all

Lkp_Num_Cards: When checking operator: Operator of type "APT_LUTCreateOp": will partition despite the
preserve-partitioning flag on the data set on input port 0.
Thanks
sam
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

After doing a search i found that by clearing the preserve partion flag this warning is handled.But can anyone help me in understanding why this happened?

Thanks
sam
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi Sam,

By default the previous stages would have a setting of propogating the existing partition to the following stages. But you would have defined a new partitioning for the following stage.

So DataStage gives a warning stating that the existing partiton cannot be preserved and rather the new partition will be used for that particular stage.

HTH
--Rich
Post Reply