Date and Time of Last Successful Job 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
snassimr
Premium Member
Premium Member
Posts: 281
Joined: Tue May 17, 2005 5:27 am

Date and Time of Last Successful Job Run

Post by snassimr »

Hi !!!

I need to know when last time the JOB finished with status Ok ( =1)
Can I know it with DS Functions without to scan Log of Job ?

Thank you
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I don't have access to the documentation here to give you the exact options, but the command is DSGetJobInfo()
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The answer is no. This is only possible by scanning the job log. DSGetJobInfo() can return the current (= most recent) job run's information.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Right... and this supposes that the 'last successful run' information is still in the log. If you really need this, you'd be better off capturing it elsewhere after every job run.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ahh, when I responded I skipped over the "successful" keyword, I thought the poster just wished the last run information. As stated, this information is not directly available and perhaps not even available at all if the log has been cleared or purged.
To date I've implemented systems where the statistics are automatically collected after each job run and added to a statistics hashed file. This can be done by several methods, each of which have their advantages and disadvantages. One method is to add an after-job call to each job, another is to have a background job running constantly and checking every n-minutes for completed run and the last method I've used is to modify the verb in the VOC that calls jobs to automatically trigger the statistics collection.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post by sachin1 »

You cannot directly test for "OK", you need to use below function and track the value of Status_value(a user defined variable), if the Status_value = 2 then your job finished "ok"

Status_value = DSGetJobInfo (DSJ.ME, DSJ.JOBINTERIMSTATUS)

also the function DSGetLogSummary can help.

but as replied earlier by ray you need to read a job log where all information is stored.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That is so wrong. Status 1 means OK, status 2 means that there was at least one warning/alert message logged. But we're straying off topic.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
snassimr
Premium Member
Premium Member
Posts: 281
Joined: Tue May 17, 2005 5:27 am

Post by snassimr »

Thank you all . It seems to collect statistics permanently and not from time to time is the best way.
Post Reply