I have a few instances where I create a secondary index on a hash file using CREATE.INDEX hash_name keyname. These hash files have been created in a directory other than the project directory. When I run the CREATE.INDEX command, DataStage creates a directory named I_hash_name (where hash_name is the name of the hash file) in the same directory as the hash_file.
The problem that I'm having is after re-creating this index several times, I have multiple files associated with this index. For example, if I have a hash file called tony_hash and I create a secondary index on it, I'll have a directory called I_tony_hash. The next time I run the routine that creates the secondary index DataStage creates a new directory and puts a "sequence number" in the name, e.g. I_tony_ha00. The original directory I_tony_hash still exists. If I run the routine that creates this index again, I will have a third directory, I_tony_ha01. This continues until I 1) run out of disk space, or 2) I run out of new directory names (it won't increment the name past I_tony_ha99).
At the top of the routine that creates this index, I have a DELETE.INDEX hash_name ALL command, so, I'm at least attempting to remove the index.
How do I keep this from happening? Is my only solution to physically delete the directory I_tony_ha?? before I create the index again?
Thanks,
Tony
Delete a secondary index file
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
That won't be enough. At one time a DELETE.INDEX has failed to complete, which is why you're seeing what you're seeing. To get back to a clean, no-index situation:
The other I_... names were created when a CREATE.INDEX command could not create I_hashedfile because it already existed.
- delete the I_... directories associated with your hashed file
execute the UniVerse command SET.INDEX hashedfile NULL
The other I_... names were created when a CREATE.INDEX command could not create I_hashedfile because it already existed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA