Page 1 of 1

Datastage Job Sequence

Posted: Fri Nov 02, 2012 8:39 am
by bond88
I created some jobs in Datastage and I want to run them in a order like if one job runs successfully then only another job has to run other wise it has to send a mail to the user which job was failed to run. Please help me with this.

Regards,
Bhanu.

Posted: Fri Nov 02, 2012 9:18 am
by ArndW
The documentation explains how stage triggers work, which is what you are looking for.

Posted: Fri Nov 02, 2012 12:06 pm
by kduke
1. I usually make all my triggers on execute "OK".
2. In job properties click automatically handle job properties that fail.
3. Add exception handler without any links to it.
4. Add link from exception handler to email notification
5. Add macro for job name to email subject
6. Add job log to notification.

Posted: Sat Apr 19, 2014 2:19 am
by vamsi.4a6
@kdude
5. Add macro for job name to email subject

I also had similar requirement but when i followed step 5 it is returning sequence name and it is not giving the parallel jobname which is aborted.In the subject i need to mention which job is aborted in sequence

Reply

Posted: Sat Apr 19, 2014 4:31 am
by ssnegi
From the Failed Trigger Links of the job activity stages connect to a Sequencer stage with option ANY.
From the Sequencer stage connect to a Use Variable Activity stage. Create a new variable. Put condition from Activity Variable option for abort :
if Job_Activity1.$JobStatus = 3 then Job_Activity1.$JobName else if Job_Activity2.$JobStatus = 3 then Job_Activity2.$JobName else ''
Then connect variable stage to Notification stage and in the subject select the UserVariableActivity variable from the variable stage.
So whichever job fails the Fail link will write the jobname to the variable stage and that will go into the subject of the email.

Posted: Sat Apr 19, 2014 11:09 am
by kduke
A nice thing we started to do was an idea that a vendor came up with. They create a done file for every job in the sequence. Each sequence has a subject name. The subject name is a part of the done file name. So to start over you delete all the done files. If you want to skip a step then manually create the done file. If you want to go back a step then manually remove the last done file. So before a job runs it check for the done file. If there then skip running the job else run the job and create the done file if the job was successful. To create a done file then just

echo "" > #jpDoneDir#/#jpSubjectArea#/Step2.done

Turn off restartability in the sequence. Done files will now control all that. Works great.