Page 1 of 1

Previous day in User variable activity

Posted: Wed Jan 23, 2013 12:21 am
by nandela.sudheer
I want the Previous day of sysdate logic in User variable activity stage in job sequence.Please help me.

Posted: Wed Jan 23, 2013 1:47 am
by ray.wurlod

Code: Select all

@DATE - 1
or

Code: Select all

Date() - 1
This gives yesterday's date in DataStage internal format. To convert to human-readable format use Oconv() function. For example

Code: Select all

Oconv(@DATE - 1, "D-YMD[4,2,2]")

Posted: Wed Jan 23, 2013 5:30 am
by nandela.sudheer
Please explain with one example.

Posted: Wed Jan 23, 2013 7:56 am
by chulett
He did. Which part is unclear? There are plenty of examples of OConv() syntax here or in the documentation if that is an issue.