Page 1 of 1

getting today's date in datastage

Posted: Thu May 31, 2007 5:01 am
by Ragunathan Gunasekaran
I would like to check a date with todays date in the datastage transformer stage .Some thing in oracle like sysdate . . . How shall i get the system date in datastage .. . Is it an function or a datastage defined constant . . . could anybody give a lending hand on this topic

Posted: Thu May 31, 2007 5:17 am
by vijaydev
use this for current timestamp "DateCurrentDateTime("1")"

syntax of the function

Posted: Thu May 31, 2007 5:24 am
by Ragunathan Gunasekaran
Vijay ,
could u give me the syntax of the function provided so tat it would be helpfull to analyse the function completely

Re: getting today's date in datastage

Posted: Thu May 31, 2007 5:41 am
by satyanarayana
you can use DSJobStartTimestamp OR DSJobStartDate

Posted: Thu May 31, 2007 5:45 am
by vijaydev
its a in built routine i am passing 1 as default argument

Re: getting today's date in datastage

Posted: Thu May 31, 2007 5:50 am
by chulett
Ragunathan Gunasekaran wrote:How shall i get the system date in datastage .. . Is it an function or a datastage defined constant
Yes. You've got both. Check the online help for:

Code: Select all

Date()
@DATE
Time()
@TIME
TimeDate()
These are various ways to get the time and/or date from the system. What Vijaydev mentioned is a supplied transform and not a routine, actually. Open up the Manager to the Transforms/sdk/Date branch and you'll see it. Double-click on it for the details and you'll see it just uses the functions listed above in addition to the 'Conv' brothers. And takes a 'dummy' argument that it doesn't use. It and the others there should give you ideas.

So, a myriad of ways to get what you need exist.

Posted: Thu May 31, 2007 5:52 am
by Maveric
Think you can use Date() function in transformer. If you want to compare it with another date then make sure the date formats are same.

Re: getting today's date in datastage

Posted: Thu May 31, 2007 5:52 am
by chulett
satyanarayana wrote:you can use DSJobStartTimestamp OR DSJobStartDate
Correct, those are macros that would give you a static value, if that's what one needed.