Updating a single column 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
KeithM
Participant
Posts: 61
Joined: Thu Apr 22, 2004 11:34 am
Contact:

Updating a single column in a hash file.

Post by KeithM »

Is it possible to update just a single column in a hash file without losing the rest of the data on the record? I have a hash file records that consists of a key, a status, and some other data. I want to just update the status but when I do just the single field the rest of the data is cleared. Is it possible to do this without reading the record first to get other data?
Keith
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, not that I am aware of... as least not directly. You may be able to access the hash via a UV stage and then do 'normal' SQL against the data. You'd need to either have the hash in your Project or create a VOC record for it (if pathed) for the UV stage to work.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Change it to a UV stage. You can do any kind of SQL against it then. Another way is to exec a TCL command and give it an update statement.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I also advocate the UV stage. The other method you specified, of reading the record first, updating it, and overwriting does work using Hashed File stages if you have some particular reason for wanting to do so. In this case, make sure that the link used for reading the record has "lock for update" set in its properties.
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