CREATE.INDEX

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
amsh76
Charter Member
Charter Member
Posts: 118
Joined: Wed Mar 10, 2004 10:58 pm

CREATE.INDEX

Post by amsh76 »

Can somebody please help with Syntax of CREATE.INDEX statement for HF with 3 key columns A,B,C.

Is it CREATE.INDEX HF A,B,C ?

Thank you
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,

Try CREATE.INDEX hashedfilename colname
Then you have to build the index if the hashed file has data in it.

BUILD.INDEX hashedfilename ALL

Ketfos
amsh76
Charter Member
Charter Member
Posts: 118
Joined: Wed Mar 10, 2004 10:58 pm

Post by amsh76 »

Somehow its not identifying the Col names..? It gived the error if I try CREATE>INDEX HF A,B,C
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
What is the error message?
Ketofs
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you want to build separate indices on the three columns?

You do not need an index on the combined key (which is called @ID), since this is already taken care of by the hashing algorithm.

When the three key values are put together, they are assembled into a character string with a text mark (@TM, or Char(251)) as the default delimiter.

To create three indexes on three separate columns you first need a VOC entry to the hashed file. Do you have one? In that case, the syntax is

Code: Select all

CREATE.INDEX hashedfile A B C
with spaces separating the column names.

You can not create a combined index unless the hashed file was created with a CREATE TABLE statement. If that's the case, then you use standard SQL syntax for CREATE INDEX to create the index.
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