Can Hash File have more than one keys?

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
fyaqq
Participant
Posts: 43
Joined: Thu Aug 31, 2006 5:05 pm

Can Hash File have more than one keys?

Post by fyaqq »

Some times I need to create hash files with more than one keys. But in the transformer stage, I can't look up what I want.
Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A hashed file can have only one primary key (at a physical level), but it can have more than one column in that key. The total number of characters in all key columns may not exceed the number specified by MAXKEYLENGTH parameter in the uvconfig file.

To perform a lookup against a hashed file, a key expression must provide a value for each of the hashed file's key columns. It is NOT possible to perform a partial key lookup against a hashed file using a Hashed File stage, though it can be accomplished by a UV stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Edwink
Participant
Posts: 47
Joined: Sat Aug 19, 2006 4:57 am
Location: Chennai

Post by Edwink »

Ray, can u say wat wil be the lengthlimit for the primary key colum(physicallevel)?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

EdWink - Ray did say what that length is - go to the uvconfig file in your DS directory and look for the value of MAXKEYLENGTH
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

The default is 768.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In older versions (earlier than 6.0?) the default was 255. Nowadays it's 768, as Kim observes. Larger keys have implications for sizing the groups (pages) in the hashed file; after all, the entire key must be able to be stored. For example, the combination of 768-character keys and 512-byte pages simply would not work.
Recommended practice, for best performance, is to keep the size of hashed file keys (and, indeed, the size of hashed file data records) as small as possible.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

Edwink wrote:Ray, can u say wat wil be the lengthlimit for the primary key colum(physicallevel)?
alternatively on unix you can try this command from your OS command prompt

Code: Select all

$DSHOME/bin/smat -a | grep MAXKEYSIZE
Post Reply