writing record 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
luca
Participant
Posts: 81
Joined: Wed May 14, 2003 11:34 pm

writing record in a Hash File

Post by luca »

Hi !
When a job writes record in a Hash File Stage.
What appends when a record has the same key than a record already stored in the hash file :
- is the old record replaced by the new one ?
- or is the first record which was already in the hash fiel kept and the new one ignored ?
Thanks for your reply.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Last one in wins. [:)]

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

Post by ray.wurlod »

Depends how you access it.

If you write via a hashed file stage, the entire record is replaced.
If you write via a UV stage, you can choose the update strategy (the usual techniques; insert, update, insert before update, update before insert, and so on).
If you use the DataStage BASIC Write statement the record is over-written, but you may in your routine have pre-read the record and only modified certain fields.


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Good to know, thanks for the clarification!

-craig
Post Reply