Lookup problem

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
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Lookup problem

Post by rajkraj »

Hi Folks,

How to specify this lookup condition in transformer;

Eff_str_dt<=ctrl_dt and Eff_end_dt>=ctrl_dt

Basically I am getting ctrl_dt as source and Eff_str_dt & Eff_end_dt in hash file.


Thanks,
Raj
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

With Server Job, Pretty much as you have specified.

Code: Select all

In Constraints :

in.ctrl_dt >= Lkp.Eff_str_dt and in.ctrl_dt <= Lkp.Eff_end_dt

Or are you looking for something else....
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

Eff_str_dt and Eff_end_dt are keys in hash file, I made link these two columns with ctrl_dt so hash file trying to match eff_dts with cntrl_dt but my condition is different. How to write this code in hash file key expression?

us1aslam1us wrote:With Server Job, Pretty much as you have specified.

Code: Select all

In Constraints :

in.ctrl_dt >= Lkp.Eff_str_dt and in.ctrl_dt <= Lkp.Eff_end_dt

Or are you looking for something else....
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Do not link the fields just write the constarint ...
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

Those are key columnes, if u don't make a link it will give compilation error right?
us1aslam1us wrote:Do not link the fields just write the constarint ...
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

That constarint is for filtering the data so there might be some other fields which can be referenced as Keys.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can not perform a range lookup to a hashed file using a Hashed File stage. The Hashed File stage can only look for exact key values (which it does via the file's hashing algorithm, which is extremely efficient).

You can perform such a lookup against a hashed file using a UV stage, which accesses the hashed file using SQL. It will probably be slow unless you index the constraining columns.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You should be more assertive, Ray.

It will be dog slow unless you index the constraining columns. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
vipshiva
Participant
Posts: 26
Joined: Thu Sep 28, 2006 4:48 am

Post by vipshiva »

Raj,
Use OCI stage for lookup instead of Hased file.... and then
In the constraints

in.ctrl_dt >= Lkp.Eff_str_dt and in.ctrl_dt <= Lkp.Eff_end_dt

Regards,
Shiva.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

vipshiva wrote: Use OCI stage for lookup instead of Hased file.... and then
In the constraints

in.ctrl_dt >= Lkp.Eff_str_dt and in.ctrl_dt <= Lkp.Eff_end_dt
How that is going to change the scenario my friend?
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
vipshiva
Participant
Posts: 26
Joined: Thu Sep 28, 2006 4:48 am

Post by vipshiva »

Actually Raj mentioned that Eff_str_dt and Eff_end_dt are keys in hash file.
So when you don't connect with Eff_str_dt and Eff_end_dt fields, DS will give compilation error right?...
That's why I have given that solution ya....

Regards,
Shiva.....
Post Reply