after job routine for 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
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

after job routine for a sequence

Post 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.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No such thing in a Sequence job, use an Execute Command stage to do that.
-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 »

If you have already written the before/after subroutine code you could create an interlude routine and invoke that via a Routine activity.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post 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...
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post 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.
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post 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 ..
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post 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....
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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...
-craig

"You can never have too many knives" -- Logan Nine Fingers
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post 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....
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Luxury!!! We never had ones, and sometimes there weren't enough zeroes so we had to use capital O's.
:lol:
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