How to Delete a set of Records from the 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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

SMK

Hash files are considered to be a temporary holding area and should not be used like a real database. Most developers which have used DataStage for several years use the delete and create option. This is safest and fastest way.

If you really want to delete records then you can write a before job routine which executes a TCL statement. Normal SQL will work like:
delete from MyHashFile where key1 = 'whatever' and key2 = 'whatever';

Kim.
dickfong
Participant
Posts: 68
Joined: Tue Apr 15, 2003 9:20 am

Post by dickfong »

SMK

You may want to try

DELETEU FileVariable, RecordKey

if you want to delete the record in a DS routine.

Dick
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Hi,

If you use a UV-Stage instead of a hash-Stage you are even able to delete records with a job.


Wolfgang Huerter
=====================
Cologne, Germany
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Be aware that records in hashed files are not date-stamped. Therefore, unless one of the fields within each data record contains a date-stamp of some kind, there is no mechanism for identifying the records that you might want to delete.
For example, the DataStage job logs are hashed files but, in this case, there is a field called TIMESTAMP that is used by the purge utilities.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Post Reply