How to add one day in date in datastage server

Pooja picture Pooja · May 13, 2013 · Viewed 8.8k times · Source

How to add one day in VDate column where column VDate value is not fixed.

Example:

input VDate = "2013-02-07"

output VDate = "2013-02-08"

Please suggest.

Answer

Damienknight picture Damienknight · May 14, 2013

Convert the date into a date type, then you can add or subtract days.

IConv converts a string into a datastage internal date format. Then you can perform addition/subtraction on the date. Then use OConv to convert the variable back to string format.

If this is done in a transformer stage, you need to do this all in one statement:

OConv(Iconv(VDate ,"D/YMD[4,2,2]") + 1), "D/YMD[4,2,2]")

http://www.dsxchange.com/viewtopic.php?p=330354&sid=bf68da51aa1b8e81c41a68a9233b7634