Delete a secondary index 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
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Delete a secondary index file

Post by tonystark622 »

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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:
  • delete the I_... directories associated with your hashed file

    execute the UniVerse command SET.INDEX hashedfile NULL
This form of the SET.INDEX command removes the linkage between the hashed file and its index directory.

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.
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Post by tonystark622 »

Thanks, Ray! I knew it had to be something like this, but didn't know where to go with it. I appreciate your help.

Tony
Post Reply