Page 1 of 1

How to get yesterday date in job sequence

Posted: Mon Jul 25, 2016 3:46 am
by vamsi_4a6
In job sequences How to get yesterday date in job sequence.For todays date we can use DSJobStartDate and in parallel jobs we can use dateoffsetbycomponents not sure about job sequences.

Posted: Mon Jul 25, 2016 7:08 am
by qt_ky
Have you tried searching?

Posted: Mon Jul 25, 2016 7:27 am
by chulett
Seriously, it's not like you're the first person to ask this over the years. Short answer? Today's date in internal format, subtract 1, convert to external.

Posted: Mon Jul 25, 2016 4:56 pm
by ray.wurlod
Note, in particular, that sequence jobs are NOT parallel jobs. They execute using the server engine. You do NOT need parallel job functions in sequence jobs.

Re: How to get yesterday date in job sequence

Posted: Mon Jul 25, 2016 10:23 pm
by SURA
I would use unix command

Code: Select all

date +%Y:%m:%d -d

Posted: Tue Jul 26, 2016 4:22 pm
by ray.wurlod
SURA wrote:I would use a UNIX command
You would. :lol:

But there are perfectly adequate DataStage BASIC expressions that can be used directly when assigning parameter values in a job activity (or storing them in user variables) without the need to create additional shells.

For example @DATE - 1 returns yesterday's date (based on the sequence start time) in internal format, while Date() - 1 returns yesterday's date (based on the system time when it is executed) in internal format.