Hash file lookup fails - double quotes

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
gomez
Premium Member
Premium Member
Posts: 83
Joined: Tue Jun 22, 2004 6:11 am

Hash file lookup fails - double quotes

Post by gomez »

Hi
I have created a hash file with 6 columns as keys, 5 of them are of Varchar and 1 SmallInt.

When I try to do the lookup using the hashfile, the lookup doesnt return any records even though there is a match from the source.

I compared the data between the source sequential file and hash file. The data in them seems to match except that all fields in the hash file are enclosed by double quotes. I tried changing NLS to ISO-8859-1, doesnt seem to help

Any clue on how I can avoid double quotes in the hash file data?

Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

How are you creating the hashed file? If from a flat file, make sure you have quote character as (") so that they dont get transfered to the hashed file.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
gomez
Premium Member
Premium Member
Posts: 83
Joined: Tue Jun 22, 2004 6:11 am

Post by gomez »

Thanks for the quick response!

I am creating the hash file from a SQL 2000 table. There are a couple of active stages inbetween - Row merger and transformer.


In the transformer, I use CRC32 function on the incoming record and load the keys and output of CRC32 function into the hash file.
CRC32 column is of type Varchar too. This is not enclosed in double quotes however !!!

Thanks again
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm curious how you 'compared the data between the source sequential file and hash file'. Are you saying that you actually see double-qoutes in the data fields when you click View Data in the hashed file stage? Or did you do something else to compare the two?
-craig

"You can never have too many knives" -- Logan Nine Fingers
gomez
Premium Member
Premium Member
Posts: 83
Joined: Tue Jun 22, 2004 6:11 am

Post by gomez »

Yes, I compared using View Data option and I could see double quotes enclosing the varchar data (key) fields
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't know of any mechanism - outside of something deliberate - that would quote strings like that. Usually it takes a miss-configured stage, like a Sequential stage, to do so. Meaning, data is written out with 'normal' quots around the character fields and then the file is read back in either with '000' specified as the quote character or if it reads the entire record as one long string. Then you'd see something like that where the quotes now are considered to be part of the data.

However, you've said that the process that actually creates the hashed file is from a 'SQL 2000' table. Can you describe the exact stages used?
-craig

"You can never have too many knives" -- Logan Nine Fingers
gomez
Premium Member
Premium Member
Posts: 83
Joined: Tue Jun 22, 2004 6:11 am

Post by gomez »

Thanks chulett!
I am using a Row merger stage in the job. Figured out just now that this is where the quote character was getting inserted.

Instead of the default quote character " in the Format tab of Row merger, I now gave 000. And the hash file does not get any double quotes in the data.

Thank you all for the help!!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Interesting... haven't had a need to use it at all yet, so wasn't aware it could pull that little trick on a person. Good to know. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply