Join Stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
khaja.arshad
Participant
Posts: 30
Joined: Mon May 29, 2006 11:19 pm

Join Stage

Post by khaja.arshad »

Hello All

I have Two Sequential files

Iam Joining these two Files Using Join Stage based on the Key Column Which is a varchar..im Using the same column name to join these Files
It getting compiled but ..During run time no value is Coming out of the Join Stage

I have tried with to search the Forum but i am unable to get results bcoz of Network restrictions in our Organisation

Any help would be highlyAppriciated

Thanks in Advance
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

Few questions for you-
1. What is the type of join? If inner, are you sure there is at least one row in both file where you have same key value.
2. What type of partitioning are you doing for input links in the join stage?

Sometimes even if you have same metadata in both the files for key columns, actual value may not match.
E.g. If I am matching on column NAME defined as VC(10). In file the value will be 'AAA ' (has space after value)and in one file value might be 'AAA'. So when you view data, you will see they have same values.
So before joining VC columns, ensure that they do not have unnecessary spaces in their value by trimming leading and trailing spaces.
Regards,
S. Kirtikumar.
khaja.arshad
Participant
Posts: 30
Joined: Mon May 29, 2006 11:19 pm

Post by khaja.arshad »

Hi Kumar

Im Using inner join on Mobile_Number which is Varchar(15) in both files and im doing hash partetioning on Both

It seems to be correct what you said on Trim

But my sources to the Join Stage are Sequential files

Can you please tell me hw to do the Trim on Seqential file column which are directly connectiong to the Join Stage
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

First have you check whether you have at least one row in input where you have same value for column mobile number?
If not, add/update one records to have same number.

To trim the these columns, you will have to use transformer stage. There use the TrimLeadingTrailing function on the mobile number column and then send it to the join stage.
Regards,
S. Kirtikumar.
khaja.arshad
Participant
Posts: 30
Joined: Mon May 29, 2006 11:19 pm

Post by khaja.arshad »

Thanks Kumar

Now it's working
The problem was even though the fields were having the same size there was some trailing spaces

i have done trim function..now it's working

instead of trnasformer im going to use the Modify stage..let's see hw it will work
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If both the stream keys are varchar, shouldnt it take care by it self?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No. DataStage does not change the data. If there are trailing spaces in the data (for example) then they're 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.
khaja.arshad
Participant
Posts: 30
Joined: Mon May 29, 2006 11:19 pm

Modify Stage-Trim-Data

Post by khaja.arshad »

Hello Ray

Can you Please Share your knowledge Hw Modify stage handle leading and trailing Space ..

Iam asking Trimming of the Data.

Thanks in Advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

string_trim[character,direction,justify](string)

or

trim_leading_trailing(string)

See page 13-7 of Orchestrate Operators manual for full details.
Last edited by ray.wurlod on Thu Oct 12, 2006 2:27 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ukyrvd
Premium Member
Premium Member
Posts: 73
Joined: Thu Feb 10, 2005 10:59 am

Post by ukyrvd »

kumar_s wrote:If both the stream keys are varchar, shouldnt it take care by it self?
no .. it can only handle variable length values

like varchar 10 can handle "abc" "abc1234567" .. but it still treats "abc " different from the way it treats "abc"
thank you
- prasad
Post Reply