A basic question in DataStage joins

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
OrenSleepwalker
Participant
Posts: 1
Joined: Mon May 14, 2018 5:22 am

A basic question in DataStage joins

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Will await your responses to Craig's questions.
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