Page 1 of 1

after job routine for a sequence

Posted: Tue Sep 25, 2007 10:02 pm
by Minhajuddin
Hi all,

I have a batch file which archives the source, target and the intermediate files. I want this to be executed in three cases.

1) When the sequence executes successfully
2) When the sequence aborts.
3) When it stops because of warnings.

I searched for ran after job routine option, but was unable to find one. Please help.

Thank you.

Posted: Tue Sep 25, 2007 10:39 pm
by chulett
No such thing in a Sequence job, use an Execute Command stage to do that.

Posted: Tue Sep 25, 2007 11:32 pm
by ray.wurlod
If you have already written the before/after subroutine code you could create an interlude routine and invoke that via a Routine activity.

Posted: Wed Sep 26, 2007 12:14 am
by Minhajuddin
Thanks for the replies...

I can do this -->
1) When the sequence executes successfully --> Add an execute command activity after all the jobs with OK Conditional trigger.
2) When the sequence aborts. Add an execute command activity after all the Exception handler.
3) When it stops because of warnings. --> What do I use for this?

My sequence design is

Code: Select all

Job1
  |
  |(OK Conditional)
  V
Job2
  |
  |(OK Conditional)
  V
...
...
...
Job50
  |
  |(OK Conditional)
  V
ExecuteCommand(Archive the files)


ExceptionHandler-------->ExecuteCommand(Archive the files)---->Terminator

Thanks for the help...

Posted: Wed Sep 26, 2007 1:21 am
by ameyvaidya
Point 3 will be taken care of along with Point 2.

The exception handler code will be trigerred when DataStage does not know how to proceed in the middle of a sequence map.


E.g.

Code: Select all

Job1-----> Job2-----> Job3
     OK         OK

Exception Handler-----><Do Something>
If Job 1/2 ends in a status other than OK, the exception handler will be triggered and execution will continue after exception handler stage.

Posted: Wed Sep 26, 2007 8:56 am
by Minhajuddin
ameyvaidya wrote:Point 3 will be taken care of along with Point 2.

The exception handler code will be trigerred when DataStage does not know how to proceed in the middle of a sequence map.


E.g.

Code: Select all

Job1-----> Job2-----> Job3
     OK         OK

Exception Handler-----><Do Something>
If Job 1/2 ends in a status other than OK, the exception handler will be triggered and execution will continue after exception handler stage.
I have just tried it out.....
Whenever I have a warning in Job1, the sequence ends with this message.....

Code: Select all

archiving_sequence..JobControl (DSWaitForJob): Job ds_modify0 has finished, status = 2 (Finished with warnings)
Any other method to do this..

Thank you ..

Posted: Wed Sep 26, 2007 10:01 am
by chulett
Handle the exceptions yourself. Use 'otherwise' links to a Sequencer set to Any and then to your archival routine. Run it again after Job3 unconditionally.

Posted: Wed Sep 26, 2007 10:49 am
by Minhajuddin
Hi Craig,

For a sequence with 3 jobs this is easy...
But my sequence has almost 50 jobs......
This approach would be tedious in my scenario...


Thanks for the replies....

Posted: Wed Sep 26, 2007 12:03 pm
by chulett
So? Doesn't tedious pay just as well as easy? :wink:

At least it's only a one time tedious. Be glad you young whipper-snappers have Sequence jobs now, back in my day we only had ones and zeroes...

Posted: Wed Sep 26, 2007 12:15 pm
by Minhajuddin
If there is no other option, then we have to go with it even if it is "tedious" :)
Thanks for all your help guys....

Posted: Wed Sep 26, 2007 4:07 pm
by ray.wurlod
Luxury!!! We never had ones, and sometimes there weren't enough zeroes so we had to use capital O's.
:lol: