Retrieving end time of last run

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
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Retrieving end time of last run

Post by ogmios »

I'm busy writing a reporting program on the jobs that ran last night in DataStage. For this I'm writing a BASIC job that will output the data of all of the jobs in a project: number of links written over all links, start time, job status, ... This will then later on be processed externally to report on "error" conditions.

If I do it this way there does not seem to be an easy way to get the end time of the last run of a job (except for reading the log files). Does anyone know an easy solution to get the end time of the last run of a job.

Changing the jobs themselves to write statistics (inside the job you can get the end time easily) is not an option since I have a couple of hundred jobs in production.

Regards,
Ogmios
uneumann
Participant
Posts: 21
Joined: Tue Jan 14, 2003 5:50 am

Post by uneumann »

Why don't you use MetaStage for this?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Apart from reading the log, there's not much you can do. You will already have established that DSGetJobInfo() can give you the job start time, but not the job finish time.
Usually DSGetNewestLogId(hJob,DSJ.LOGANY) will return the event id of the last entry in the log, then you can use DSGetLogEntry() to retrieve the detail, amongst which is the finish time for the job.
Post Reply