datastage job logic
Moderators: chulett, rschirm, roy
datastage job logic
Hi I want to develop a job,with the following req,
i/p 3 columns
id,date,price
1,05/01/2011,100
1,06/01/2011,200
1,07/01/2011,100
2,06/01/2011,1000
3,12/01/2011,1000
4,10/01/2011,100
4,11/01/2011,200
4,12/01/2011,150
assume my run date is 12/012011,
Now there are 3 cases I need to discuss,
case 1:
records with id=1 having dates as 05,06,07 and prices are 100,200,100 respectively,
since rundate is 12/01/2011,I need to generate the same ids those number of times in order to fill the date gap and price should be last available date price should be carried on
in this case
the output should be
id,date,price
1,05/01/2011,100
1,06/01/2011,200
1,07/01/2011,100
1,08/01/2011,100
1,09/01/2011,100
1,10/01/2011,100
1,11/01/2011,100
1,12/01/2011,100
case 2:
records with id=2 having dates as 06/01/2011 and prices are 1000.
since rundate is 12/01/2011,I need to generate the same ids in order to fill the gap date and price should be last available date price should be carried on
in this case
the output should be
id,date,price
2,06/01/2011,1000
2,07/01/2011,1000
2,08/01/2011,1000
2,09/01/2011,1000
2,10/01/2011,1000
2,11/01/2011,1000
2,12/01/2011,1000
case 3:
records with id=3 having dates as 12/01/2011 and prices are 1000.
since rundate is 12/01/2011,I need not generate the ids in order to fill the date gap
in this case also as it is
the output should be
id,date,price
3,12/01/2011,1000
case 4:
records with id=4 having dates as 10/01/2011,11/01/2011,12/01/2011.
since rundate is 12/01/2011,I have dates till 12/01/2011 so no need to no need to fill any gap
in this case also as it is
the output should be
id,date,price
4,10/01/2011,100
4,11/01/2011,200
4,12/01/2011,150
final output combining case1,case2,case3,case4 my output would be
1,05/01/2011,100
1,06/01/2011,200
1,07/01/2011,100
1,08/01/2011,100
1,09/01/2011,100
1,10/01/2011,100
1,11/01/2011,100
1,12/01/2011,100
2,06/01/2011,1000
2,07/01/2011,1000
2,08/01/2011,1000
2,09/01/2011,1000
2,10/01/2011,1000
2,11/01/2011,1000
2,12/01/2011,1000
3,12/01/2011,1000
4,10/01/2011,100
4,11/01/2011,200
4,12/01/2011,150
thanks in advance for the help
i/p 3 columns
id,date,price
1,05/01/2011,100
1,06/01/2011,200
1,07/01/2011,100
2,06/01/2011,1000
3,12/01/2011,1000
4,10/01/2011,100
4,11/01/2011,200
4,12/01/2011,150
assume my run date is 12/012011,
Now there are 3 cases I need to discuss,
case 1:
records with id=1 having dates as 05,06,07 and prices are 100,200,100 respectively,
since rundate is 12/01/2011,I need to generate the same ids those number of times in order to fill the date gap and price should be last available date price should be carried on
in this case
the output should be
id,date,price
1,05/01/2011,100
1,06/01/2011,200
1,07/01/2011,100
1,08/01/2011,100
1,09/01/2011,100
1,10/01/2011,100
1,11/01/2011,100
1,12/01/2011,100
case 2:
records with id=2 having dates as 06/01/2011 and prices are 1000.
since rundate is 12/01/2011,I need to generate the same ids in order to fill the gap date and price should be last available date price should be carried on
in this case
the output should be
id,date,price
2,06/01/2011,1000
2,07/01/2011,1000
2,08/01/2011,1000
2,09/01/2011,1000
2,10/01/2011,1000
2,11/01/2011,1000
2,12/01/2011,1000
case 3:
records with id=3 having dates as 12/01/2011 and prices are 1000.
since rundate is 12/01/2011,I need not generate the ids in order to fill the date gap
in this case also as it is
the output should be
id,date,price
3,12/01/2011,1000
case 4:
records with id=4 having dates as 10/01/2011,11/01/2011,12/01/2011.
since rundate is 12/01/2011,I have dates till 12/01/2011 so no need to no need to fill any gap
in this case also as it is
the output should be
id,date,price
4,10/01/2011,100
4,11/01/2011,200
4,12/01/2011,150
final output combining case1,case2,case3,case4 my output would be
1,05/01/2011,100
1,06/01/2011,200
1,07/01/2011,100
1,08/01/2011,100
1,09/01/2011,100
1,10/01/2011,100
1,11/01/2011,100
1,12/01/2011,100
2,06/01/2011,1000
2,07/01/2011,1000
2,08/01/2011,1000
2,09/01/2011,1000
2,10/01/2011,1000
2,11/01/2011,1000
2,12/01/2011,1000
3,12/01/2011,1000
4,10/01/2011,100
4,11/01/2011,200
4,12/01/2011,150
thanks in advance for the help
Thanks & Regards,
Sai
Sai
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi Ray,
can you pls site an example,bcos,to use a copy stage I have more than 50,000 ids, I cannot substream and later funnel each stream,Pls let me know if my understanding is wrong,
I will be more happy if you can elaborate the answer with a small example
step by step
thanks
sai123
can you pls site an example,bcos,to use a copy stage I have more than 50,000 ids, I cannot substream and later funnel each stream,Pls let me know if my understanding is wrong,
I will be more happy if you can elaborate the answer with a small example
step by step
thanks
sai123
Thanks & Regards,
Sai
Sai
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I assumed you'd use a separate stream for each style of processing, given that their rules differ. To generate multiple records, create a lookup containing just a list of dates, and do a range lookup between the max date from the data and the current date.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If it's already in production, and working, why are you asking the question? If you worked with me, the rule would be "nothing is ever changed in production" - a proper software development lifecycle is followed.
Last edited by ray.wurlod on Thu Jan 13, 2011 2:20 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.