Difference between DSLogfatal and DSStopJob

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Madhu1981
Participant
Posts: 69
Joined: Wed Feb 22, 2006 7:49 am

Difference between DSLogfatal and DSStopJob

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Madhu1981
Participant
Posts: 69
Joined: Wed Feb 22, 2006 7:49 am

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

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or 'Stopped'. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Madhu1981
Participant
Posts: 69
Joined: Wed Feb 22, 2006 7:49 am

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

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
Madhu1981
Participant
Posts: 69
Joined: Wed Feb 22, 2006 7:49 am

Post 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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I try. Not quite up to Wurlod standards where you work. your. way. through. every. new. post, but I try. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply