Current Timestamp

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
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

Current Timestamp

Post by kab123 »

Hi All,

I have to create a new column and have to give the current timestamp for that. what expression/Derivation I need to give with that.
Database is SYBASE.

Thanks in advance .
abhi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Current timestamp in ISO8601 format is given by

Code: Select all

Oconv(Date(), "D-YMD[4,2,2]"):" ":Oconv(Time(), "MTS:")
Substitute system variables @DATE and @TIME for Date() and Time() if you want "current timestamp" as at the start time for the job, instead of as at "now".

Sybase OC expects YYYYMMDD HH:MM:SS.sss as the format. If you don't need milliseconds use

Code: Select all

Oconv(Date(), "D-YMD[4,2,2]":@VM:"MCN"):" ":Oconv(Time(), "MTS:"):".000"
If you do need milliseconds, you will need to create a Routine, in which you enabled $OPTIONS TIME.MILLISECOND and then use SYSTEM(12) to obtain the number of milliseconds since midnight. And that's assuming your operating system can deliver clock milliseconds.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

Post by kab123 »

Thanks Ray

Abhi
Post Reply