Join Stage
Moderators: chulett, rschirm, roy
Join Stage
I have 2 inputs A and B which go through a join component.
Input A
Column Name : num_rec
Data : 000123
Input B
Column Name : num_rec
Data : 000129
In my Join Component, my key is num_rec and I have specified an outer join type because in the output I want to see data from both the files. But I cannot.
I have 2 output colums num_rec_input and num_rec_ctl.
I tried putting a peek after the join and before the output file to see the data flowing and I saw the following:
Output C
num_rec_input :000123
num_rec_ctl :000000
I want to see the 000129 in the num_rec_ctl column. How can I achieve this?
Input A
Column Name : num_rec
Data : 000123
Input B
Column Name : num_rec
Data : 000129
In my Join Component, my key is num_rec and I have specified an outer join type because in the output I want to see data from both the files. But I cannot.
I have 2 output colums num_rec_input and num_rec_ctl.
I tried putting a peek after the join and before the output file to see the data flowing and I saw the following:
Output C
num_rec_input :000123
num_rec_ctl :000000
I want to see the 000129 in the num_rec_ctl column. How can I achieve this?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If num_rec is your join key you will NEVER see 000129 in a left outer join. In a left outer join you will only see matching key values (000123) or NULL.
This is the definition of a left outer join.
This is the definition of a left outer join.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 23
- Joined: Sat Sep 29, 2007 6:05 am
- Location: Datastage
- Contact:
Hai
Hai,
In case of join stage, meta data must be same. If we want to join two or more tables, we need a key column must be identical in all the tables. Then it works fine for you. Another use of join stage, it combines the data in sets.
In case of join stage, meta data must be same. If we want to join two or more tables, we need a key column must be identical in all the tables. Then it works fine for you. Another use of join stage, it combines the data in sets.
Murali
-
- Participant
- Posts: 23
- Joined: Sat Sep 29, 2007 6:05 am
- Location: Datastage
- Contact:
Hai
Hai,
In case of join stage, meta data must be same. If we want to join two or more tables, we need a key column must be identical in all the tables. Then it works fine for you. Another use of join stage, it combines the data in sets.
In case of join stage, meta data must be same. If we want to join two or more tables, we need a key column must be identical in all the tables. Then it works fine for you. Another use of join stage, it combines the data in sets.
Murali
Are you expecting to see 1 record as output? If you are using a full outer join with 2 different key values (123 and 129) I would imagine you would get 2 output records - they don't join, so you couldn't get them on the same record.
What exactly are you trying to achieve? How are 123 and 129 supposed to look on the output?
Think about how you would do this in a SQL query, because the joins in DataStage mimic that. Sometimes putting it in a different context can help figure out what you intend, and then you simply convert it into a DataStage join.
Brad.
What exactly are you trying to achieve? How are 123 and 129 supposed to look on the output?
Think about how you would do this in a SQL query, because the joins in DataStage mimic that. Sometimes putting it in a different context can help figure out what you intend, and then you simply convert it into a DataStage join.
Brad.
Actually I am expecting two records but I am getting only 1 record.bcarlson wrote:Are you expecting to see 1 record as output? If you are using a full outer join with 2 different key values (123 and 129) I would imagine you would get 2 output records - they don't join, so you couldn't get them on the same record.
What exactly are you trying to achieve? How are 123 and 129 supposed to look on the output?
Think about how you would do this in a SQL query, because the joins in DataStage mimic that. Sometimes putting it in a different context can help figure out what you intend, and then you simply convert it into a DataStage join.
Brad.
I was sure that the output would be 2 records. Still for it, I just tried a sample to check and I got the output as desired.
pp, you probably need to check that you have done a 'sort' and 'hash' on keys. As others have suggested, please check for the column names 'coz column should match exactly.
~ R-Square
pp, you probably need to check that you have done a 'sort' and 'hash' on keys. As others have suggested, please check for the column names 'coz column should match exactly.
~ R-Square