Function to find get Next 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
psbans
Participant
Posts: 4
Joined: Thu Feb 23, 2006 6:05 pm

Function to find get Next Date

Post by psbans »

Hi

Iam new to DataStage, can anyone help me how to get the Next avialable Date using DataStage's builtin functions,..etx.

Example: Iam using Date format as YYYYMMDD (integer) as a parameter.
So if my current parameter is 20060507, then I want next available date
as 20060508 like wise for 20060531, its 20060601.
basically i want to use the result value as parameter to another job in a sequence.


thanks
Amos.Rosmarin
Premium Member
Premium Member
Posts: 385
Joined: Tue Oct 07, 2003 4:55 am

Post by Amos.Rosmarin »

Hi,

Use the ICONV/ OCONV functions
change the date into internal representation, add 1 day and switch back to date format

e.g:

Code: Select all

nextDay = Oconv( Iconv ( yourDate , "D4YMD[4,2,2]") + 1, "D4YMD[4,2,2]")

HTH
Amos
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

And strip out the delimiters in the generated date.

Code: Select all

Oconv(Iconv(yourDate, "DYMD") + 1, "DYMD[4,2,2]" : @VM : "MCN")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
psbans
Participant
Posts: 4
Joined: Thu Feb 23, 2006 6:05 pm

Post by psbans »

it worked great.

thanks guys
Post Reply