How to find last day of the monthyear in server jobs
Posted: Tue Mar 27, 2012 3:43 am
Hi
We are working on Datastage 7.5v server jobs on windows environment.
We had a requirement to load the last day of the particular monthyear from the source.
Input :
MONTHYEAR
01/2011
02/2011
03/2011
06/2011
08/2011
01/2012
02/2012
Output :
MONTHYEAR LASTDAYMONTHYEAR
01/2011 31/01/2011
02/2011 28/02/2011
03/2011 31/03/2011
06/2011 30/06/2011
08/2011 30/08/2011
01/2012 31/01/2012
02/2012 29/02/2012
In server jobs,we dont have any function to find the last day of the monthyear.
we were able to write custom code like the MONTHYEAR[1,2] = '01' then '31/':'01/2011' and MONTHYEAR[1,2] = '02' then '28/':'02/2011' and so on....
However,this doesnot take leap year into consideration.Can anyone let me know if there is any way to handle this?
Thanks
Kiran
We are working on Datastage 7.5v server jobs on windows environment.
We had a requirement to load the last day of the particular monthyear from the source.
Input :
MONTHYEAR
01/2011
02/2011
03/2011
06/2011
08/2011
01/2012
02/2012
Output :
MONTHYEAR LASTDAYMONTHYEAR
01/2011 31/01/2011
02/2011 28/02/2011
03/2011 31/03/2011
06/2011 30/06/2011
08/2011 30/08/2011
01/2012 31/01/2012
02/2012 29/02/2012
In server jobs,we dont have any function to find the last day of the monthyear.
we were able to write custom code like the MONTHYEAR[1,2] = '01' then '31/':'01/2011' and MONTHYEAR[1,2] = '02' then '28/':'02/2011' and so on....
However,this doesnot take leap year into consideration.Can anyone let me know if there is any way to handle this?
Thanks
Kiran