How to get yesterday date in job sequence

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
vamsi_4a6
Participant
Posts: 95
Joined: Wed Jun 04, 2014 12:06 am

How to get yesterday date in job sequence

Post 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.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Have you tried searching?
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: How to get yesterday date in job sequence

Post by SURA »

I would use unix command

Code: Select all

date +%Y:%m:%d -d
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply