Read Hash File in Routine

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
yiminghu
Participant
Posts: 91
Joined: Fri Nov 14, 2003 10:09 am

Read Hash File in Routine

Post by yiminghu »

Hi,

I want to read a hash file in a server routine. I know I can use the statement "READ FileRec FROM Handle, Key", but if I have mutiple keys, how do I specify them?

I was trying to look for a document about how to read hash file using basic language, but could not get any. Does anyone know whether there is a reference book available?

Thanks,

Yiming
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

If you built the hash file using a job them the key fields are separated by @TM. So:

Key = KeyField1 : @TM : KeyField2 : @TM : KeyField3
read Rec from HashFilePtr, Key else Rec = ''
Field1 = Rec<1>
Field2 = Rec<2>

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

Re: Read Hash File in Routine

Post by ray.wurlod »

yiminghu wrote:I was trying to look for a document about how to read hash file using basic language, but could not get any. Does anyone know whether there is a reference book available?
The manual you need is the DataStage BASIC manual, which is part of the documentation set.
OPEN, READ, WRITE, CLOSE and their variants all apply to hashed files.
(They apply just as well to other UniVerse file types, but that's not what you're trying to learn just now.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
yiminghu
Participant
Posts: 91
Joined: Fri Nov 14, 2003 10:09 am

Re: Read Hash File in Routine

Post by yiminghu »

Thanks a lot. It works perfectly.
Post Reply