Write to Hash table from 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
Zinna
Participant
Posts: 16
Joined: Thu Jul 25, 2002 9:32 pm
Location: Australia

Write to Hash table from Routine

Post by Zinna »

Hi,

I want to write to a hash file in a before/after routine. I am using the WRITE statement, it is fine when the hash file only has one field as key, but my hash file has two fields as key and I can't write to the second key field.

This is a snippet of my code, which works as it only has one field as key:

Open HashTable To FileHandles(POS) Then
Write Rec To FileHandles(POS), HashKey Else
Rec = DSRMessage("DSTAGE_TRX_I_0010" , "**UNABLE TO WRITE RECORD**", "" )
End
End

The syntax for WRITE seems only to accept ONE key field. Does anyone know how I can update more than one key field? Be it with the WRITE statement or something else?

Thanks,
Zinna
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

I have not done exactly what you are trying, but I know the keys of a compound key hash file are separated by a text mark (@TM). You might try building the key like: key1 : @TM key2

John
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

Correction to previous reply -

the key should be build like: key1 : @TM : key2

John
Zinna
Participant
Posts: 16
Joined: Thu Jul 25, 2002 9:32 pm
Location: Australia

Post by Zinna »

Perfect! Exactly what I wanted it do it. Thanks John.

Zinna
Post Reply