First column in Hashed file should be a keyfield

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
jzijl
Participant
Posts: 23
Joined: Thu Jul 20, 2006 6:09 am

First column in Hashed file should be a keyfield

Post by jzijl »

Hello,

I have read that the first column of a hashed file should be a keyfield. In the application I work on I have seen that this is not always the case although the job does what it has to do.

Can you tell me what the consequences are when the first column in a hashed file is not a keyfield and what if multiple key columns in a hashed file are not adjacent.

Kind regards,

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

Post by ray.wurlod »

Hashed files are not navigated by field name or even by position in the grid, but by position in the data record. In the Columns grid on a hashed file stage you will find a column called Position; any field (column) with Position 0 is a key, while non-key fields are numbered 1, 2, 3 and so on.

Provided the table definition was imported from the hashed file itself, and not edited, then the order in the Hashed File stage is not particularly relevant.

Physically, however, the key is stored ahead of the non-key fields in a hashed file, so nominating the field positions in the correct order leads to more efficient I/O.
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