look up

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
satya99
Participant
Posts: 104
Joined: Thu Nov 30, 2006 1:22 pm

look up

Post by satya99 »

In my job design i have one source(hash file) and 1 lookups( hash file).

When i find a value in lookup as A1 then i need to concatenate the value coming from source with 1 and hook that value
When i find a value in lookup as A2 then i need to concatenate the value coming from source with 2 and hook that value
When i find a value in lookup as A3 then i need to concatenate the value coming from source with 3 and hook that value


source

A

LOOKUP1

A1
A2
A3
..

Any idea.

thanks in advance
satya
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Re: look up

Post by DeepakCorning »

Are you saying tht the lookup can have A1 , A2 and A3 at the same time? or a single value?

If it has all the values then what should be assigned to the output?

If only one is present in the lookup then here is the way u can handle it --

Create the Hashed file with two columns - One column Substring(Lookup , 1,1) which can be the key column , the second column with the actual value.
When the Value matches it will pull out the actual column.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

need more information

Post by rafik2k »

What is the output u want from the job?

As per ur data, there there is 1 rows in source and in the hash file there is matching row.
The basic rule of using hash file as a lookup is that u need to have one key field in it which will match the source(driving table) table's field.

If u elaborate and give some more sample data then some one will be able to give appropriate solution.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Re: look up

Post by rafik2k »

DeepakCorning wrote:Are you saying tht the lookup can have A1 , A2 and A3 at the same time? or a single value?

If it has all the values then what should be assigned to the output?

If only one is present in the lookup then here is the way u can handle it --

Create the Hashed file with two columns - One column Substring(Lookup , 1,1) which can be the key column , the second column with the actual value.
When the Value matches it will pull out the actual column.
if u use Substring(Lookup , 1,1), then as per data provided it will look like
A
A
A
..
then how u can make it as key field?
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Re: look up

Post by DeepakCorning »

rafik2k wrote:
DeepakCorning wrote:Are you saying tht the lookup can have A1 , A2 and A3 at the same time? or a single value?

If it has all the values then what should be assigned to the output?

If only one is present in the lookup then here is the way u can handle it --

Create the Hashed file with two columns - One column Substring(Lookup , 1,1) which can be the key column , the second column with the actual value.
When the Value matches it will pull out the actual column.
if u use Substring(Lookup , 1,1), then as per data provided it will look like
A
A
A
..
then how u can make it as key field?
Please read "Are you saying tht the lookup can have A1 , A2 and A3 at the same time? or a single value?

If it has all the values then what should be assigned to the output? "
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your job design needs three lookups, not one.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

ray.wurlod wrote:Your job design needs three lookups, not one. ...

that means if hash file have data like following then we need 4 lookup?

LOOKUP1
A1
A2
A3
A4
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, if your logic is that posted by satya99.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

How many maximum concatenated running numbers can you have? If you have a max then you can generate the extra rows. Do a simple lookup and you will automatically get a hit on the hashed file with the key you want.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply