Hash File-Is there any way to insert duplicates

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
suma
Participant
Posts: 32
Joined: Fri Jun 11, 2004 8:18 am

Hash File-Is there any way to insert duplicates

Post by suma »

I am using a hash File to load data into the Target,Is there any way to load duplicate records into the target,For example I have EmpNAme and DOJ as my source column and i am making the EMPNAME as the Key and in the Hash File stage,automatically all the Duplicate records are removed!

One thing is i can generate Keys and make that as a KEY!!!

Is there any other way to add the duplicate record without generating a key column...


What i mean is there any thing called multi valued hash Files that supports this concept?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No.

Only non-key columns can be multi-valued in hashed files.

You need a generated key. Make it an Integer, and generate it as @OUTROWNUM in the Transformer stage that loads the hashed file. Specify, in the hashed file creation options, that the hashing algorithm is SEQ.NUM.

If you're using a UV stage to load the hashed file, you can create a hashed file with auto-incrementing key by customising the CREATE TABLE statement to include DEFAULT NEXT AVAILABLE in the primary key column.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
suma
Participant
Posts: 32
Joined: Fri Jun 11, 2004 8:18 am

Post by suma »

I am not very clear with system variables.What does @OUTROWNUM do?
and why should make the hashing Algorithm as SEQ.NUM?

"If you're using a UV stage to load the hashed file, you can create a hashed file with auto-incrementing key by customising the CREATE TABLE statement to include DEFAULT NEXT AVAILABLE in the primary key column"


And why should we go for universe Stage?I have imported a Hash FIle using universe File Defnitions from the Manager.Can u tell me how to customize the Create Table Statement.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

@OUTROWNUM numbers the rows leaving a Transformer on an output link.

When the keys form an unbroken integer sequence, the dynamic hashed file SEQ.NUM hashing algorithm is far more efficient than the default, GENERAL, hashing algorithm.

Every UniVerse table is physically a hashed file. So, when you create a table with the UV stage, you're creating a hashed file. You can access this through a UV stage or through a Hashed File stage once it has been created.

Of course, if the hashed file exists already, then you can't use CREATE TABLE.

The UV stage has a "create table" check box which, when checked, enables an "Edit DDL" tab. It is on this tab that you can modify the CREATE TABLE statement.

Similarly, the Hashed File stage has the ability to create the hashed file. You edit the creation properties by clicking the Options button that is enabled when the "create file" check box is checked.
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