Datastage Job Sequence

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
bond88
Participant
Posts: 109
Joined: Mon Oct 15, 2012 10:05 am
Location: USA

Datastage Job Sequence

Post 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.
Bhanu
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The documentation explains how stage triggers work, which is what you are looking for.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post 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
Thanks and Regards
Vamsi krishna.v
http://datastage-vamsi.blogspot.in/
ssnegi
Participant
Posts: 138
Joined: Thu Nov 15, 2007 4:17 am
Location: Sydney, Australia

Reply

Post 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.
Last edited by ssnegi on Sat Apr 19, 2014 7:04 pm, edited 17 times in total.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
Post Reply