Splitting of date range
Moderators: chulett, rschirm, roy
Splitting of date range
Hi,
I want to split the date range based on the given number of days.
For Example.
Input Date Range - Oct 1 and Oct 9
Input Number of days - 3
My Output should be the following 3 date ranges with 3 days in each chunk
Oct 1 and Oct 3
Oct 3 and Oct 6
Oct 6 and Oct 9
Please suggest how can i achieve this with DataStage
Also let me know if i am not clear with the above description
Thanks in Advance
MUS
I want to split the date range based on the given number of days.
For Example.
Input Date Range - Oct 1 and Oct 9
Input Number of days - 3
My Output should be the following 3 date ranges with 3 days in each chunk
Oct 1 and Oct 3
Oct 3 and Oct 6
Oct 6 and Oct 9
Please suggest how can i achieve this with DataStage
Also let me know if i am not clear with the above description
Thanks in Advance
MUS
with in the trasformer just write a constraint with the datefield ,let us suppose your input date range is 3 day s and your inputdate like jan 1 to jan 9then you have to write constraint like
substr(inputdatefield,1,3) = 'jan' and (substr(inputdatefield,3,1) = 1 or substr(inputdatefield,3,1) = 2 or substr(inputdatefield,3,1) = 3)
manully . i hope it should have another mobile to resolve simply.
substr(inputdatefield,1,3) = 'jan' and (substr(inputdatefield,3,1) = 1 or substr(inputdatefield,3,1) = 2 or substr(inputdatefield,3,1) = 3)
manully . i hope it should have another mobile to resolve simply.
D.N .MURTHY
Hi Murthy,
I hope you were not clear about my requirement.
I exactly want the date range.
It is like if i am giving an input dates and number of days as
input date1 - 20091001
input date2 - 20091010
No of days - 3
Then it should give 3 date ranges like
20091001 and 20091003
20091003 and 20091006
20091006 and 20091009
Let me know if i am not clear.
I know how to to this using pl/sql.But i want to do it in datastage.
Thanks!
MUS
I hope you were not clear about my requirement.
I exactly want the date range.
It is like if i am giving an input dates and number of days as
input date1 - 20091001
input date2 - 20091010
No of days - 3
Then it should give 3 date ranges like
20091001 and 20091003
20091003 and 20091006
20091006 and 20091009
Let me know if i am not clear.
I know how to to this using pl/sql.But i want to do it in datastage.
Thanks!
MUS
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Do you really want overlapping ranges, most of which are N+1 days, or not? Did you really mean
20091001 and 20091003
20091004 and 20091006
20091007 and 20091009
20091001 and 20091003
20091004 and 20091006
20091007 and 20091009
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
See how vitally important accurate specifications are!
Only now could someone work on this implementation without wasting time.
Now, to complete the specification, do you need these in separate rows or in separate columns or in some other format (such as a delimited string)?
Only now could someone work on this implementation without wasting time.
Now, to complete the specification, do you need these in separate rows or in separate columns or in some other format (such as a delimited string)?
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The specification is clear. We're now in think time, because nothing immediately comes to mind. It's easy in a server routine, but your question asks how to do it in a DataStage parallel job (which would probably need to execute in sequential mode).
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.