Issue with date and 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
hari4dsx
Participant
Posts: 14
Joined: Wed Feb 13, 2008 4:53 am

Issue with date and timestamp

Post by hari4dsx »

Hi,

We are using the following function to populate date with corresponding timestamp in one of the fields

"Oconv(Date(),"DYMD"):Oconv(@TIME,"MTS")"

The function gives correct results but for a job whose execution started at 11:55 PM on 3rd March and ended at 12:05 AM 4th Mar, we got the following two values as the Last_Update_Date:
11:55:06PM 03-Mar-2009 and
11:55:06PM 04-Mar-2009

The first value is correct but the second value is wrong.

Can any body please explain as why are we facing this issue and what could be the potential solution?

Thanks a lot in advance.
Hari
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Try Time() instead of @Time
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The reason behind Sainath's suggestion is that @TIME is set when the job starts, whereas Time() captures the system clock value at the moment it is invoked.
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