Add Months to a Date
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 12
- Joined: Mon Nov 27, 2006 1:28 am
Add Months to a Date
Could you please give some guide lines how to Add months to a date in DataStage PX?
Thanks in Advance.
Regards,
Prasanta
Thanks in Advance.
Regards,
Prasanta
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There's nothing out of the box. Design your algorithm (incorporating your business rules, such as what happens if the date is January 31 and you add one month) and create a routine. Or get a database query to perform it.
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 Oconv() and Iconv() functions used in that routine might make life tricky, however.
You could, I guess, use the ICI functions ic_iconv() and ic_oconv(). You will find these documented in the Intercall Reference Guide on the IBM UniVerse web site.
You could, I guess, use the ICI functions ic_iconv() and ic_oconv(). You will find these documented in the Intercall Reference Guide on the IBM UniVerse web site.
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: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad
Thanks Ray for this routine on your home page.
I went through the routine for AddMonth()
I want to use this routine in the transformer stage and add 6 months to the current date.
I created a server routine and compiled it. It works fine. I am using PX 7.5.2
I have never called a transform routine in the transformer routine in the transformer stage. Could anyone explain in detail how to call this routine. Or is it that we can't execute a server routine in a transformer stage.
One more doubt in the routine written by Ray we use Iconv() and Oconv() functions these are function that can be used in server jobs only... is that right? Then how would I use this routine in a PX job.
I went through the routine for AddMonth()
I want to use this routine in the transformer stage and add 6 months to the current date.
I created a server routine and compiled it. It works fine. I am using PX 7.5.2
I have never called a transform routine in the transformer routine in the transformer stage. Could anyone explain in detail how to call this routine. Or is it that we can't execute a server routine in a transformer stage.
One more doubt in the routine written by Ray we use Iconv() and Oconv() functions these are function that can be used in server jobs only... is that right? Then how would I use this routine in a PX job.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
BASIC routine ---> server job only, or BASIC Transformer stage in parallel job
Parallel routine ---> parallel job
You could, as suggested, re-write the logic as a parallel routine (in C++) and invoke that from a parallel Transformer stage.
Parallel routine ---> parallel job
You could, as suggested, re-write the logic as a parallel routine (in C++) and invoke that from a parallel Transformer stage.
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: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad