Length of a field in 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
rbpty
Premium Member
Premium Member
Posts: 6
Joined: Sat Jun 21, 2008 7:58 am

Length of a field in Hash File

Post by rbpty »

Hello,
I am having a problem using the hash file in which the length of a column exceeds 1500 chars. In my job design, I am creating a record in a dynamic hash file (Type30) which is the concatenation of multiple fields and I am using this field to lookup on the file that I am getting from the Mainframes.

Now the problem is whenever the length of the field exceeds 1500 chars, the hash is not working properly and the lookup fails.

Is there any limitation on the length of the field in a hash file.

please advice.

Thanks in advance,
Mike
daignault
Premium Member
Premium Member
Posts: 165
Joined: Tue Mar 30, 2004 2:44 pm
Contact:

Re: Length of a field in Hash File

Post by daignault »

rbpty wrote:Hello,
I am having a problem using the hash file in which the length of a column exceeds 1500 chars. In my job design, I am creating a record in a dynamic hash file (Type30) which is the concatenation of multiple fields and I am using this field to lookup on the file that I am getting from the Mainframes.

Now the problem is whenever the length of the field exceeds 1500 chars, the hash is not working properly and the lookup fails.

Is there any limitation on the length of the field in a hash file.

please advice.

Thanks in advance,
Mike
There is a max length for a key structure. I believe in the uvconfig file it is called MAXKEYSIZE . This can have adverse effects to the underlying locking tables under Datastage and adjustments should be performed on a test environment.

Is there any reason you can't reduce the size of the key?

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

Post by chulett »

Hashed file, not hash file.

And as Ray noted, the default max key size is 768 and I would really advise against changing that, if at all possible. If you cannot reduce the size, why not create multiple keys rather than one huge concatenated one? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The limit is on the physical structure of the key, not on a single key column. That is, MAXKEYSIZE affects the maximum allowable size of @ID.

If you increase MAXKEYSIZE (you need to edit uvconfig, shut down the DataStage services, regenerate the system (disk) shared memory segment and re-start DataStage) you will need to ensure that all hashed files are created with GROUP.SIZE 2 (or, in the case of static hashed files, with a separation of at least 8).
Last edited by ray.wurlod on Thu Apr 23, 2009 4:36 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... in other words, if you had multiple key fields and their combined size was over the MAXKEYSIZE you would still have an issue? Dang. I knew that, honest.

ps. 8) is an 8 followed by a right parenthesis, if you were wondering about Ray's "with a separation of at least 8)" statement. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
rbpty
Premium Member
Premium Member
Posts: 6
Joined: Sat Jun 21, 2008 7:58 am

Post by rbpty »

Thank you all for the advice.. I was using this gigantic key as an input to the routine with other fields. I tried creating multiple fields and concatinating them in the routine. But still it did not work...


I will keep trying.. In the mean time, anyone with better ideas.. please suggest.

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

Post by ray.wurlod »

When you concatenate key columns for a hashed file they must be separated with the declared separator character. If you have not declared an explicit separator character the default separator character is a text mark, accessible via the system variable @TM.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply