Month End Date

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Month End Date

Post by Amit_111 »

Hi All,

I have a date in the format 'YYYYMMDD'. It will be the last day of a month for eg. 20080831 now I need to derive two dates from this date one is Start date of next month i.e. "20080901" and End Date "20080930".

I searched in the forum and found out the solution for parallel version. The functions mentioned are not in Server version.
Anyone has done this is Server version or if any pointers??

Thanks in Advance.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Month End Date

Post by sachin1 »

hello please try this, may be some more efficient methods are also available

for first day of next month for your input
oconv( ( MONTH.first(MONTH.TAG(ICONV("20080831","DYMD") + 1))),"D-YMD[4,2,2]").---->2008-09-01

for last day of month for given input

oconv( ( MONTH.LAST(MONTH.TAG(ICONV("20080831","DYMD") + 1))),"D-YMD[4,2,2]")---->2008-09-30
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Month End Date

Post by chulett »

Amit_111 wrote:I searched in the forum and found out the solution for parallel version. The functions mentioned are not in Server version.
Funny, I searched for "month end date" and was able to find several Server posts on the subject.
-craig

"You can never have too many knives" -- Logan Nine Fingers
tennetiharika
Participant
Posts: 11
Joined: Mon Feb 25, 2008 5:53 am
Location: Hyderabad

Post by tennetiharika »

You can even find the solution in data stage help.not a big deal
tennetiharika
Participant
Posts: 11
Joined: Mon Feb 25, 2008 5:53 am
Location: Hyderabad

Post by tennetiharika »

You can even find the solution in data stage help.not a big deal
Post Reply