Page 1 of 1

Difference between DSLogfatal and DSStopJob

Posted: Mon Jun 05, 2006 6:45 am
by Madhu1981
HI All,

I would like to know that what is the difference between DsLogFatal, Abort and DsStopJob.

What is the major difference between DSLogFatal and DSStopJob. I am totally confused with these two functions.

Why do we require Abort function, when we have DsLogfatal.
Please Help me

Posted: Mon Jun 05, 2006 6:53 am
by DSguru2B
Well in your DataStage help, you can just search for those worlds.

DSLogFatal - It logs a fatal error message in that particular jobs log file and aborts the job.

DSStopJob- As the name suggests, it sends a stop request to the DS engine.

Posted: Mon Jun 05, 2006 7:01 am
by ArndW
To add to what Roy has written:

DSLogFatal() will stop the current job with a fatal error code and message to the log file.

DSStopJob() will issue a job stop request to the job whose JobHandle is passed to the routine.

If a job hits the DSLogFatal() call it will stop and will not return. If the code is executed outside of a job run (i.e. as part of a routine which is called in test mode from the manager) then it will log an error message to the screen but continue execution.
The DSStopJob() issued to a job will sometimes not work, it does the same thing that happens when you stop a job from the Director. When a job is hanging or looping in a user-written routine it will not respond to the stop request.

Posted: Mon Jun 05, 2006 7:07 am
by Madhu1981
DSguru2B wrote:Well in your DataStage help, you can just search for those worlds.

DSLogFatal - It logs a fatal error message in that particular jobs log file and aborts the job.

DSStopJob- As the name suggests, it sends a stop request to the DS engine.
Thanks a ton guru,

I have a small question, Suppose if the job gets aborted by using DSLogfatal, will the datastage jobs will be running in DSEngine or not.

If not, then why should we have to go for DSStopJob.

What will be the status of the job after using DSStopJob()

Posted: Mon Jun 05, 2006 7:14 am
by ArndW
DSLogFatal() will stop the job from running and update the log file. DSStopJob() will issue a stop request, and if the job gets stopped then it will also have a status of aborted in the log.

Posted: Mon Jun 05, 2006 7:53 am
by chulett
Or 'Stopped'. :wink:

Posted: Mon Jun 05, 2006 8:08 am
by Madhu1981
ArndW wrote:DSLogFatal() will stop the job from running and update the log file. DSStopJob() will issue a stop request, and if the job gets stopped then it will also have a status of aborted in the log. ...
Thanks Arnd,

One more small question, What is the difference between Abort and DSLogFatal functions. Please help me

Posted: Mon Jun 05, 2006 9:19 am
by ArndW
The DS/BASIC "ABORT" function without an expression should not be used in DataStage, it will terminate a job immediately, unlike the DSLogFatal() which will not only abort the job but update the job run information and perform other cleanup tasks

Posted: Mon Jun 05, 2006 3:46 pm
by ray.wurlod
There is an argument never to use any of these, but to maintain control and propagate warnings up to the master control job sequence and handle them there. You can build in enough logic to ensure that the typical abort situations do not even occur.

Posted: Mon Jun 05, 2006 5:09 pm
by kduke
I like both Abort and DSLogFatal(). The sequence should catch either if the right box is checked. It is a personal preference. Ray and Arnd are usually correct in the sense things work better if you avoid these 2 ways to stop a job. Ray likes things neat and orderly. I think that is pretty wise.

Posted: Tue Jun 06, 2006 6:04 am
by Madhu1981
kduke wrote:I like both Abort and DSLogFatal(). The sequence should catch either if the right box is checked. It is a personal preference. Ray and Arnd are usually correct in the sense things work better if you a ...

Thanks a lot Kduke,

Could you please explain me in detail

Posted: Tue Jun 06, 2006 6:38 am
by kduke
I think I explained myself. What did you not understand? Ray does not like to see aborted jobs in the Director. He wants to control the ETL without aborting jobs. This seems pretty smart to me. There is a check box in a sequence to automatically handling aborted jobs. This requires using an exception handler. So it is possible to control aborts this way even though it is ugly.

I think it is fun to tease Ray and Arnd by disagreeing with them as a joke. They are so determined to do things the best way possible that they act like their way is the only way. Their way in this case is the cleanest way but not the only way possible. Do it ugly and be happy. All of this is just advice. It is not criminal to disagree or do something contrary to Ray, me or Arnd. I take it for granted that most of us disagree with Craig because he is such a trouble maker.

I think I have a problem without people disagreeing in a friendly manor. Sometimes 2 opposing views will push us to learn and then decide our choice. Dare to be wrong. Voice your thoughts. Sometimes you might learn something just by getting in the discussion. A lot of what is voiced here in this forum is not fact. It is best practice. It sometimes can be done a different way but few state their different methods. I want to see more choices. Maybe your choice has value even though Ray or a top poster does it differently.

Posted: Tue Jun 06, 2006 6:53 am
by chulett
kduke wrote:I take it for granted that most of us disagree with Craig because he is such a trouble maker.
:shock: Whaaaaat???

Pot-kettle-black, my friend. :lol:

Posted: Tue Jun 06, 2006 8:14 pm
by kduke
Craig

Sometimes I think we are the only ones on here with a sense of humor. Just checking to see if you are reading all these posts.

Posted: Tue Jun 06, 2006 8:59 pm
by chulett
I try. Not quite up to Wurlod standards where you work. your. way. through. every. new. post, but I try. :wink: