Missing Column in Hash 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
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Missing Column in Hash File

Post by vinaymanchinila »

ColA ColB ColC
==== ==== ====
Ter 1 SPU
Ter 2 SPU
Ter 1 OCI
AUS 1 ORA


I have 3 columns in my hash file, only ColB and Column C make a key if combined. The issue is I have ColB in my source file but not Col C .

Is there a workaround for this look up.
Thanks
Sunshine2323
Charter Member
Charter Member
Posts: 130
Joined: Mon Sep 06, 2004 3:05 am
Location: Dubai,UAE

Missing Column in Hash File

Post by Sunshine2323 »

Hi,

If u have keys defined in your Hash File then a look up has to be done against all the keys.

As can be seen from your data that values in any column are not unique and hence you have two columns forming the key.

If you create a new Hash File with only column B as the key, then the duplicates will be overwritten and that won't make any sense.

Depending on your requirement check whether you insert a COL C and hard code it to some value that can be looked up and is repeting for all the values of COL B
Last edited by Sunshine2323 on Tue May 03, 2005 6:29 am, edited 1 time in total.
Warm Regards,
Amruta Bandekar

<b>If A equals success, then the formula is: A = X + Y + Z, X is work. Y is play. Z is keep your mouth shut. </b>
--Albert Einstein
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Vinay,

a lookup stage to a hash file must use the whole key, so if it is a combined key you must know all parts of it for a lookup to function.
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Yes, I agre we need to look up all the keys, but I am in this situation. By the way can you throw some light on multi row look up and how it is done.
Thanks
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

Multirow lookup is available from 2 stages: ODBC and the Universe stage. It is enabled from the properties of the transformer (not in the stage). One row from the primary stage will result in 0, 1 or multiple rows being available for output depending on the match on the key and the number of rows in the lookup data.

It sounds like it might work for your situation if you use the Universe stage to access your hash file. I have used multirow lookup with the ODBC stage, but not with the Universe stage. Give it a try and let us know.

John
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

ds_developer - is multirow available at Rev. 6.x?
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

Arnd,

I don't have 6.x available (I'm on 7.01), so I can't say for sure. The eService KnowledgeBase says it was available in 6.0r3 for both ODBC and Universe.

John
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi John,
We are upgrading to 7.5 this Friday, so if you can let me know which .pdf file I can refer to for the mutli row look up , it would be awesome.
Thanks,
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

You will find it in 'servjdev.pdf'; search for 'multirow'.
John
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

I guess it is not available in 6.0.1, will try it in 7.5. In 6.0.1 I dont even get "Link Properties" when I right click on the link!.
Thanks for the info .
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you doing it from inside the Transformer? That's where you need to be right-clicking.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

I have a ODBC stage look up and I go inside the Trasformer Stage and right click on the look up link. I donot have the option for Link Properties! Is it not the way in 6.0.1 !
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes you do. It's a check box, usually in the lower left-hand corner. But you need first to open the link properties window.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi Ray,
I am using version 6.0.1 and in my job I have one source flat file, one ODBC look up, transformer and a target flat file. When I open the transformer stage, I have 3 link boxes. On the hash link when I right click or double click I donot find the "LinkProperty" option itslef!.
Can you help me out if its a version of DS issue or am I doing something out of way.
Thanks,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure! Try this! :wink:

In the Transformer, don't right-click on the links themselves (i.e. the lines that join the boxes), click instead on the 'box' that represents the Hash stage lookup. Then you'll get Link Properties as one of the options.

Also as noted, you must use a UV or ODBC stage to get the extra special option to enable Multirow Lookups.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply