Delete a secondary index file
Posted: Thu Nov 04, 2004 3:09 pm
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
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