Datetime Finish job

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
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Datetime Finish job

Post by jseclen »

how obtain the datetime of the finish job?

there is a routine DSGetJobInfo but this return the JOBSTARTTIMESTAMP...

Is there a routine that return the datetime when the job finish ???

Miguel Seclen
Lima - Peru
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's not available through DSGetJobInfo function.
What most sites do is, because they're running the job from a job control routine, determine the system time when DSWaitForJob returns, or when it is detected that the job is no longer running (if using a "busy loop").
Date() returns the system date in internal format.
Time() returns the system time in internal format.
Oconv(Date(),"D-YMD[4,2,2]"):" ":Oconv(Time(),"MTS:") yields a timestamp.
This does not generate milliseconds, but this level of measure is not likely to be required.

The other way is to inspect the log entry that signals the finish of the job. You can determine which entry this is by using DSGetNewestLogId with DSJ.LOGSTARTED as its EventType argument, then using DSGetLogEntry to obtain the detail.

EventID = DSGetNewestLogId(hJob, DSJ.LOGSTARTED)
If EventID > 0
Then
EventDetail = DSGetLogEntry(hJob, EventID)
JobFinished = Field(EventDetail, "", 1, 1)
End


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

jseclen

The date and time is store in RT_CONFIG###. It is very tricky to read this file. It is not the recommended way but there is no other way to get everything that is listed in DataStage Director. I have basic code to read this accurately but I want to create a way to distribute it without explaining how to do things in Universe outside of DataStage because that is how it works best. The code is included in DsWebMon a product I sell. It will soon be included in DwNav another product I sell. I think row history and start and stop times are critical for performance tuning and trending. I have thought about posting it on my website. If I get enough requests then maybe I will. There have been lot of requests for copying parameters. Maybe I will post that code as well. I don't think you should have to buy my product or Parameter Management just to be able to do some of these things. If we want a real user group then we need to share real solutions with code. Most of these answers are real vague so you can buy products or services from these experts. If I get enough requests then I will show you how my products work.

Thanks Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
Post Reply