Page 1 of 1

A basic question in DataStage joins

Posted: Mon May 14, 2018 5:33 am
by OrenSleepwalker
Hi all,
I'm rather new to DataStage, so I was hoping you'll be able to help me with a rather easy question.

I'm currently trying to write a join between a main table and an auxilliary one oin the source side. The join should be with the following key:
MAIN.A = AUX.A and MAIN.B = AUX.B and MAIN.C = MAX(AUX.C) where AUX.C <= MAIN.C.
Then I populate some fields from both MAIN and AUX into a target table.

How do I create such a condition? Obviously A and B are easy, but how do I create C and add it to the key?

Posted: Mon May 14, 2018 7:11 am
by chulett
Welcome. :D

Not that it matters quite yet but are you working with Server or Parallel jobs? I suspect the latter even though the post is marked for the former. As noted, it won't change any answers (yet) but just wanted to clarify.

So... your source is a relational database and all three tables are in the same source? If so then your join can happen in a single source stage and you write it just like you would in any other client tool. Select the appropriate fields from any of the three tables to stream into the job and then split them as needed to your two targets. If that's not the case, please let us know.

Posted: Mon May 14, 2018 4:42 pm
by ray.wurlod
Will await your responses to Craig's questions.