Get previous job completion status

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

Get previous job completion status

Post by Marley777 »

Hi, thanks for reading.

Is there a way to get the previous job status for a sequencer or a job. If for example I have a sequencer that will always restart from the beginning, how can I ask the sequencer what it's last completion status was. If it finished with an abort or warning I want to send processing down different paths within the sequencer. I can't find any previous run status dskob commands.

thanks for any help you can give.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

All you've got is the "most recent" job status, there's no history stored. So you'd have to check outside of the sequence itself as any checking the sequence itself does (say 'before job') would be after it had already started. Seems to me you'd need to have your job control check first and then pass in a parameter for the previous status so it knows how to behave. That job control could be a script or it could even be another 'wrapper' sequence that checks and then runs the sequence in question.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could check the sequence's log, where there may be enough old entries for you to determine the most recent successful completion (after all, log purge does not occur if a job (or sequence) fails).

Otherwise, if you're on version 8.7 or later and have implemented DataStage Operations Console, then you can query the DSODB database for your history.
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 »

Ah... interesting point about the DataStage Operations Console, wasn't aware of that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

You can get old statuses out of the log. I have a job in EtlStats which loops thru the RT_LOG file to get these old statuses and row count. You would have to convert it to either use dsjob or use the API to call a routine to get old log messages. Not too hard.

The easier way would be to call a job to start the sequence and before it starts it gets the last status. You could get last parameter values and row counts too if that would help.
Mamu Kim
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

Post by Marley777 »

Thank you kduke, ray.wurlod and chulett for your replies. I'll give your thoughts a try. Thanks again.
Post Reply