DataRange comparision

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
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

DataRange comparision

Post by satheesh_color »

Hi All,

I have the below requirement, please let me know your thoughts on this.

I have a table which contains the values for the pattern:
Store_id, Pattern, Flg, Start_Date, End_Date
123, 801, N, 20081101, 20081110
123, 802, N , 20081111, 20081125
123, 803, Y , 20081126, 99991231


One more store table contains storeid and start_date

123 , 20081115

All i need to do is check the start_date(20081115) which lies between any of the above start_date and End_Date values and get the corresponding pattern values.

Need your inputs on this.


Thanks.
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Since you said the data is from tables, why don't you do this directly in SQL.. simple join and a WHERE clause will do this.
Kandy
_________________
Try and Try again…You will succeed atlast!!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do your lookup using a database stage with user-defined SQL. Specify start_date as the Key column (it means "search key" in this context) and include the parameter marker in a BETWEEN clause in the WHERE clause.
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