How to get tne name of Aborted Job in a Sequence

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
theverma
Participant
Posts: 91
Joined: Tue Jul 18, 2006 10:41 am
Location: India

How to get tne name of Aborted Job in a Sequence

Post by theverma »

Dear all,

I have a Job Sequence which has two Jobs.
I am invoking this Job Sequence using Command Line.
I case of failure of this Job Sequence,I want the name of the Job which has made the sequence in aborted state.Means the Name of the Job which gets abort.
I am using command line for all operations of ETL Jobs.
I looked for logsum option of dsjob command but i know only the name of Sequence and that's why logsum option will not give me the actual reason for the aborted job.

So how we can find the name of the Job in a Sequence which has been aborted if you know only the Job Sequence Name?

Thanks in Advance
Arun
Arun Verma
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Two options came up to my mind right now.
1. You can check the individual job logs for the status
2. You need to connect ExecuteCommand Activity to each JobActivity for Failed link and pass JobName as parameter to print it to a file. Your script can check for that predefined file for Job name when JobSequence is aborted.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Post by ds_is_fun »

JOB_STATUS=`$DSHOME/bin/dsjob -jobinfo $PROJECT $JOB | head -1 | cut -d"(" -f2 | cut -d")" -f1`
echo $JOBSTATUS
# Runnable Job Status codes-
# 1 "Finished"
# 2 "Finished (see log)"
# 9 "Has been reset"
# 11 "Validated OK"
# 12 "Validated (see log)"
# 21 "Has been reset"
# 99 "Compiled"

# NOT Runnable Job Status codes-
# 0 "Running"
# 3 "Aborted"
# 8 "Failed validation"
# 13 "Failed validation"
# 96 "Aborted"
# 97 "Stopped"
# 98 "Not Compiled"
theverma
Participant
Posts: 91
Joined: Tue Jul 18, 2006 10:41 am
Location: India

Post by theverma »

Please note that i am using Windows Server Edition.

Can we get the name without modifying the Job?
I know to get solution we have to do changes but it would be really great if we can find out the solution without making any change to the Job.

Thanks
Arun Verma
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Post by ds_is_fun »

theverma wrote:Please note that i am using Windows Server Edition.

Can we get the name without modifying the Job?
I know to get solution we have to do changes but it would be really great if we can find out the solution without making any change to the Job.

Thanks
Run the command from the bin location of your DS installed on Windows.
dsjob -jobinfo $PROJECT $JOB

1.Point a variable to the above command.
2. Catch job status.
3. Check if the value of the variable is in a Runnable state or Non-runnable state.
AND proceed.

That should do it.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The job sequence's log summary will include the exit status of each job invoked from the job sequence. If you have a hierarchy of job sequences you may need a more complex script using either iterative or recursive techniques to search the entire tree of control.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply