Current date as a Parameter

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
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Current date as a Parameter

Post by suja.somu »

Can we supply current date ( todays date) as a parameter in a Parallel job.
Can I do this in Sequencer.
What are the ways to do this ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

1. No.
2. Not in a Sequencer, but yes in a Sequence.

My preferred formula in an expression in a Sequence is to use the @DATE and @TIME system variables, but you could use Date() and Time() functions instead. Assuming that you don't want fractional seconds, a suitable formulation is

Code: Select all

Oconv(@DATE,"D-YMD[4,2,2]") : " " : Oconv(@TIME, "MTS")
or

Code: Select all

Oconv(Date(),"D-YMD[4,2,2]") : " " : Oconv(Time(), "MTS")
The difference is that the system variables are set when the Sequence starts; Date() and Time() reflect "now".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

And - of course - CurrentDate() and CurrentTime() (--> now) are always available as a Transformer-function in a parallel job. So they do not necessarily have to be passed to the job as a parameter.

It depends on what you need: Start-time of the job, start time of the sequence calling the job or the exact time an operation is performed within the job (for example an insert to a database).
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
Post Reply