Creating secondary index on hash file from a routine

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
cfuller
Premium Member
Premium Member
Posts: 70
Joined: Mon Mar 24, 2003 10:08 pm
Location: Australia

Creating secondary index on hash file from a routine

Post by cfuller »

Hi all

I have a hash file being access using UV stage by partial key, for a multi-row lookup, that was performing very badly. I created an index on the lookup column, from the UV command line, reran the job and the performance was closer to what I expected. Now I want to create and build the index in a before stage routine, but I'm not getting any joy.

I have tried to utiles the code in the ExecTCL routine but to no avail.

Here is the code I'm using -

Code: Select all

      Call DSExecute("TCL", "CREATE.INDEX vHashFile vIndexCol", Output, SystemReturnCode)
Where vHashFile is the incoming hash file, and VinddexCol is the column to create the index on.

Any help appreciated... :?
Regards
Chris Fuller

"Reality is what refuses to go away when you stop believing in it"
cfuller
Premium Member
Premium Member
Posts: 70
Joined: Mon Mar 24, 2003 10:08 pm
Location: Australia

Post by cfuller »

Did some more digging and altered the command to now be -

Code: Select all

      Command="CREATE.INDEX " : vHashFile : " " : vIndexCol
      Call DSExecute('UV', Command, Output, SystemReturnCode)

Silly mistake on my part.... :oops: :!:
(had local variable within quoted string, instead of concatinating it all together)
Regards
Chris Fuller

"Reality is what refuses to go away when you stop believing in it"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That may not be enough. If there are data in the hashed file, you will have an empty index.

Code: Select all

Command="CREATE.INDEX " : vHashFile : " " : vIndexCol 
Call DSExecute('UV', Command, Output, SystemReturnCode) 
Command="BUILD.INDEX " : vHashFile : " " : vIndexCol 
Call DSExecute('UV', Command, Output, SystemReturnCode) 
Check SystemReturnCode after each Call; a negative value indicates that a problem has occurred.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
cfuller
Premium Member
Premium Member
Posts: 70
Joined: Mon Mar 24, 2003 10:08 pm
Location: Australia

Post by cfuller »

Thanks Ray...

Actually I had the BUILD.INDEX further down in my routine, but seeing as how I couldn't get the CREATE.INDEX to work, the BUILD.INDEX was being bypassed due to the CREATE.INDEX failing....I supplied a code snippet, not the whole routine.

Cheers :lol:
Regards
Chris Fuller

"Reality is what refuses to go away when you stop believing in it"
Post Reply