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?
A basic question in DataStage joins
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 1
- Joined: Mon May 14, 2018 5:22 am
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.
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
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: