getting today's date in datastage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Ragunathan Gunasekaran
Participant
Posts: 247
Joined: Mon Jan 22, 2007 11:33 pm

getting today's date in datastage

Post 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
Regards
Ragu
vijaydev
Participant
Posts: 54
Joined: Sun May 20, 2007 6:31 pm

Post by vijaydev »

use this for current timestamp "DateCurrentDateTime("1")"
Vijay
Ragunathan Gunasekaran
Participant
Posts: 247
Joined: Mon Jan 22, 2007 11:33 pm

syntax of the function

Post 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
Regards
Ragu
satyanarayana
Participant
Posts: 13
Joined: Fri Jul 15, 2005 12:01 am

Re: getting today's date in datastage

Post by satyanarayana »

you can use DSJobStartTimestamp OR DSJobStartDate
vijaydev
Participant
Posts: 54
Joined: Sun May 20, 2007 6:31 pm

Post by vijaydev »

its a in built routine i am passing 1 as default argument
Vijay
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: getting today's date in datastage

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

"You can never have too many knives" -- Logan Nine Fingers
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: getting today's date in datastage

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

"You can never have too many knives" -- Logan Nine Fingers
Post Reply