Need logic..

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Need logic..

Post by synsog »

I have source data like below
3902 10AM
3902 11AM
3902 2PM
3902 4PM

In target data base , i have data like this

rec1 3902 9:45AM
rec2 3902 9:50AM
rec3 3902 10:30AM
rec4 3902 11:10AM
rec5 3902 11:45AM
rec6 3902 1:30PM
rec7 3902 2:05PM
rec8 3902 2:35PM
rec9 3902 3:59PM
rec10 3902 4:23PM

Now for every source rec, i need to find the record with key match and max time of database records < source rec time

like i need to fetch the records;
3902 10AM rec2
3902 11AM rec3
3902 2PM rec6
3902 4PM rec9

how I can accomplish this scenerio in DS8.7 ?

Source data will be less than 1K every day, target data will be more than 10K every time...

Please help...

Thanks, in Advance.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What have you already tried? Why did it not succeed?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

I would suggest a sparse lookup with a custom sql to select exactly what you want.
swapnilverma
Participant
Posts: 135
Joined: Tue Aug 14, 2007 4:27 am
Location: Mumbai

Post by swapnilverma »

I would create a view which have records with max time of database records and perform a left outer join or spars look up .

Hope this will help!

:idea: :idea:
Thanks
Swapnil

"Whenever you find whole world against you just turn around and Lead the world"
Post Reply