Page 1 of 1

Exit cleanly from a Sequence job?

Posted: Thu Apr 17, 2008 1:16 pm
by val
I've searched the docs and the forums, but can't find much to go on for this problem:

I have a sequence job that is scheduled to start in the morning, runs all day waiting for input files, processes them through a few server jobs, then loops back and waits for more input until a certain time of day passes. At that point, I route to a Terminator stage to nicely ask the jobs to stop and then exit.

This all works fine, but when the Terminator executes, it logs an Abort in the job log. But I don't want an Abort -- this is not an unexpected failure, but normal successful completion at the end of the run window. We send emails to Admins on abort, and we run reports every morning looking for aborted jobs, because we take them to mean something bad happened that we need to fix. I don't want to pollute those logs with bogus 'failures', or send unnecessary problem emails.

It doesn't look like there's any way to make the Terminator log a different status. Is there any other technique I can use to cause the sequence job to exit cleanly? I'm OK with logging a warning, but don't want an abort.

Is there anything in DataStage Basic, the built-in routines, a shell script, etc. that I can use to stop the job without Abort?

Thanks!

- Val

Posted: Thu Apr 17, 2008 1:55 pm
by chulett
Don't use a Terminator for that purpose as you are not 'terminating' anything. Simply run to a Sequencer as the last thing in the job stream and the process will just stop gracefully and exit without any fuss.

Posted: Thu Apr 17, 2008 6:12 pm
by val
Thanks for the tip! I've been lamenting the lack of a 'sink' stage that I can route to when I want to just do nothing but exit. This will do the trick -- not as self-explanatory as I'd like, but functional. Thanks again!

Posted: Thu Apr 17, 2008 6:33 pm
by chulett
Give it an appropriate name and that will go a long way towards the 'self explanatory' part. :wink:

Posted: Thu Apr 17, 2008 7:23 pm
by ray.wurlod
I prefer to use a Routine activity as a sink, so as to log an entry reporting that the job sequence reached that point.

You could use UtilityMessageToLog as the routine. I don't, because it returns 1 - I use a clone of it that always returns 0.

Posted: Fri Apr 18, 2008 6:36 am
by chulett
Pretty much all objects include a place for 'Logging Text'... including Sequencers. No need for a routine. :wink: