Generate Time Stamp Value

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
Vivek Vazarkar
Participant
Posts: 30
Joined: Thu Feb 22, 2007 12:39 pm
Location: Mumbai

Generate Time Stamp Value

Post by Vivek Vazarkar »

Hi All,

Please let me know how to generate the Time stamp value in the transformer stage in the 2008-09-24 03:35:55 format.


Thanks,
Vivek
Thanks & Regards,
Vivek Vazarkar
Mail ID:-vivekvazarkar@indiatimes.com
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

what do you have as input and how does it look like?
Wolfgang Hürter
Amsterdam
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This is something you will need over and over: the ability to generate the current date/time as a timestamp. I advise that you create a Transform or even a Routine. I call mine NowAsTimestamp.

Code: Select all

Oconv(Date(),"D-YMD[4,2,2]") : " " : Oconv(Time(),"MTS:")
If you want to generate a timestamp from other input, please advise what that input looks like, as Wolfgang already asked. Or simply adapt the above code.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vivek Vazarkar
Participant
Posts: 30
Joined: Thu Feb 22, 2007 12:39 pm
Location: Mumbai

Post by Vivek Vazarkar »

WoMaWil wrote:what do you have as input and how does it look like?
Hi Thanks for your replay ?

Source is the .txt file having 5 columns and target is having 6 columns.

There is a difference of 1 columns n that column I want to populate with current date with time stamp.
Thanks & Regards,
Vivek Vazarkar
Mail ID:-vivekvazarkar@indiatimes.com
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post by sachin1 »

hello,
please try this

Oconv(@DATE, "D-YMD[4,2,2]"):' ':Oconv(@time, "MTS")
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

You can even use DSJobStartTime in DSMACRO which will give you the timestamp of when the job has started.
Arun
tennetiharika
Participant
Posts: 11
Joined: Mon Feb 25, 2008 5:53 am
Location: Hyderabad

Post by tennetiharika »

Jus select dsjobtimestamp from the DS macros.The tool will generate it for u.We need not worry at all
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

U didn't ask about generating timestamps.

The user may not want the job start timestamp - the value required may be "now". For long-running jobs this can be quite different from the job start timestamp. In this case prefer Date() and Time() functions, because the system variables @DATE and @TIME are set when the job starts and are not updated.
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