Page 1 of 1

Function to find get Next Date

Posted: Sun May 07, 2006 1:11 pm
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

Posted: Sun May 07, 2006 1:46 pm
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

Posted: Sun May 07, 2006 2:38 pm
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")

Posted: Sun May 07, 2006 3:53 pm
by psbans
it worked great.

thanks guys