Looking up a Space in a Hash file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
KV
Participant
Posts: 18
Joined: Tue May 11, 2004 11:43 am

Looking up a Space in a Hash file

Post by KV »

Hi

I have a simple job that transfers data from the source to the target and uses a look up to a hash file. Now the source data has a space as a value in 8 of its columns. Not null but a space. The hash file has also been popluated from the source and also has a space in the same fields. However on looking up it retrieves all the rows except for which the space is there. Is there a way i can look up against the space? How can I retrieve these 8 rows?

Let me know
KV
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are any of these 'space' fields keys in your hash file? I'm guessing that's the case if they are involved in the success or failure of your lookup. :? Are you sure you've trimmed or not trimmed or done whatever needs to be done to ensure that the 'space-ness' of the fields is not changed so the lookup can find a match? And don't forget - one space <> two spaces - are you sure they are all a single space?

All things being equal - a single space in your key field and a single space in the data field being used to fill the key - the lookup should work fine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

We had the same problem with version 7 while handling the space in the key fields. We had modified the job which creates the hash file to check if it is space. If so we send some special character to the column and in the lookup job we had the transforms to check from the source if it has space then change to the special character and do the lookup. It worked for us.

Thanks
Rasi
mleroux
Participant
Posts: 81
Joined: Wed Jul 14, 2004 3:18 am
Location: Johannesburg, South Africa
Contact:

Post by mleroux »

If you're still battling, how about trying to use a char(32) instead of " " to do the lookup? Or seq(" ") and lookup on an ASCII code 32?
Morney le Roux

There are only 10 kinds of people: Those who understand binary and those who don't.
Post Reply