Multiple row generation for a single row source

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
noname001
Participant
Posts: 7
Joined: Mon Aug 16, 2010 10:54 pm

Multiple row generation for a single row source

Post by noname001 »

Hi Guys,

If my souce is having one row of data and for the source row if i have multiple rows in the lookup satisfying the criteria that i define, is it possible to create multiple rows in the target for each lookup ??

For Example.

Source Table

S.NO Name Parent
1 AB01 CD01
2 AB02 CD02


Lookup Table

S.NO Name Parent
1 CD01 5
2 CD01 5
3 CD02 7


I want my result set to be

S.NO Name Parent
1 AB01 5
2 AB01 5
3 AB02 7


please provide me your inputs.
Answers appreicated.
anandsiva
Participant
Posts: 41
Joined: Wed May 21, 2008 7:58 pm
Location: Sydney

Post by anandsiva »

Use Join stage instead of look up...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No such animal in a server job.

If your secondary reference set is ODBC-accessible, then multiple rows per lookup can be returned.

If both inputs are sequential files (or can be made sequential files) then you could perform a join in a Merge 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.
sajal.jain
Participant
Posts: 11
Joined: Sat Mar 13, 2010 12:00 am

Post by sajal.jain »

use join

or

in the look up stage --> goto constraints and select the link name in "Multiple rows return from link" drop box.
Major GungHo
noname001
Participant
Posts: 7
Joined: Mon Aug 16, 2010 10:54 pm

Post by noname001 »

sajal.jain wrote:use join

or

in the look up stage --> goto constraints and select the link name in "Multiple rows return from link" drop box.

Do we have a constraints tab or sumthing in SERVER jobs ??
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Nothing of the kind sajal.jain is suggesting - seems to be a locked-in parallel job mindset going on there.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

For Server, but the ODBC and UV stages support a lookup multi-row result set and it is a property of the reference link itself.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply