Get end of Month based on year and Month
Moderators: chulett, rschirm, roy
Get end of Month based on year and Month
Can any one suggest how to get the last day of a month based on my source data
For Example
I am getting from source 200812(year and Month)
Then my output should be 20081231(end of that month and year)
Say one more example
If I am getting 200802(Year and month)
Then my output should be 20080229(end of month which is leap year)
Any Suggestions please
For Example
I am getting from source 200812(year and Month)
Then my output should be 20081231(end of that month and year)
Say one more example
If I am getting 200802(Year and month)
Then my output should be 20080229(end of month which is leap year)
Any Suggestions please
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Re: Get end of Month based on year and Month
Can any one give me the solution for below question using datastage Transformer or any solution using DataStage.
Can any one suggest how to get the last day of a month based on my source data
For Example
I am getting from source 200812(year and Month)
Then my output should be 20081231(end of that month and year)
Say one more example
If I am getting 200802(Year and month)
Then my output should be 20080229(end of month which is leap year)
Any Suggestions please[/quote]
Can any one suggest how to get the last day of a month based on my source data
For Example
I am getting from source 200812(year and Month)
Then my output should be 20081231(end of that month and year)
Say one more example
If I am getting 200802(Year and month)
Then my output should be 20080229(end of month which is leap year)
Any Suggestions please[/quote]
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
-
- Participant
- Posts: 57
- Joined: Wed Oct 21, 2009 4:46 am
- Location: India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
... except where the year number is divisible by 400.
Further, the recent earthquake in Chile may have changed the earth's rotation slightly - the year may be marginally shorter. Do you need to worry about that?
Further, the recent earthquake in Chile may have changed the earth's rotation slightly - the year may be marginally shorter. Do you need to worry about that?
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: 29
- Joined: Wed Jan 06, 2010 7:18 am
rohithmuthyala wrote:Extract the month part alone.
Check if month is 04,06,09,11 then append 30 to the existing string.
Else if month is 02 and (Year%4)=0 then append 29
Else append 31 to the existing string.
we are missing Feb 28 Month ending in this logic and how can we handle % datastage transformer
The above can be handled using Stage variables in the Transformer stage.