Page 1 of 1

Retrieving end time of last run

Posted: Thu Sep 26, 2002 1:18 pm
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

Posted: Fri Sep 27, 2002 2:32 am
by uneumann
Why don't you use MetaStage for this?

Posted: Sun Sep 29, 2002 6:31 pm
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.