Is it possible to rename a hashed 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
HSBCdev
Premium Member
Premium Member
Posts: 141
Joined: Tue Mar 16, 2004 8:22 am
Location: HSBC - UK and India
Contact:

Is it possible to rename a hashed file?

Post by HSBCdev »

Subject says it all really.

I've searched this forum without turning up anything useful.

If anybody could shed any light, I'd be most grateful.

Cheers,

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

Post by ray.wurlod »

Yes it's possible, but how you do it depends on how you created it in the first place.

If it was created in the account, then the command - which can be executed through the Administrator client Command window - is CNAME.

Code: Select all

CNAME oldname TO newname
If the hashed file was created in a directory and there is no VOC pointer to it, then use operating system commands to change both the data and dictionary portions. For UNIX the command is mv, for Windows the command is RENAME (or REN).

Code: Select all

mv /path/name/oldname newname
mv /path/name/D_oldname D_newname

Code: Select all

REN X:\Path\Name\oldname X:\Path\Name\newname
REN X:\Path\Name\D_oldname X:\Path\Name\D_newname
If a VOC entry has been created to point to a pathed hashed file, make the same change as above for the pathed hashed file, then update the VOC entry. For example, on UNIX:

Code: Select all

UPDATE VOC 
SET F0='newname', 
    F2='/path/name/newname', 
    F3='/path/name/D_newname' 
WHERE F0 = 'oldname';
Finally, if the hashed file was created as a UniVerse table, it can not be renamed, but must be dropped and re-created. If the hashed file has had indexes defined, then additional changes are required, including changing the name of the index directory from I_oldname to I_newname then executing a SET.INDEX command to tell the hashed file where its indexes now are.

If the hashed file is a part file in a Distributed file it can not be renamed.
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