How to get the job status when the job aborted???

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
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

How to get the job status when the job aborted???

Post by ICE »

Hi all,

Can we get the job status ('Aborted' ) when the job aborted( 4.x or 5.x) ???
Can I chk in the last transformer stage not to abort the job???

Thanks,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ice,

if the job has Aborted then it is no longer running, and therefore there is no way to check it's status inside of the job. The call to DSLogFatal() is immediate and doesn't return to any parts of the job.

Could you explain what you are trying to do and perhaps there is another way to solve this?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi,

Probably your requirment might be misleading.
Rather detecting for abort, check the condition for abort and so take the action accordingly.

-Kumar
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear ArndW,

Thank u so much for your response.
Actually what I wanna do is I would like to know whether the scheduled jobs are successfully runned or not.
If the job was aborted,I would like to know asap.
I am boring to chk manually everyday. :)
So I would like to make it to chk automatically.

Is there any way to do this???
Could u pls help me how can I solve this problem???


Thank u so much for ur help


ArndW wrote:Ice,

if the job has Aborted then it is no longer running, and therefore there is no way to check it's status inside of the job. The call to DSLogFatal() is immediate and doesn't return to any parts of the job.

Could you explain what you are trying to do and perhaps there is another way to solve this?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The UNIX level program "dsjob" will, with the correct options, give you the finish status of any job plus a lot of other information. You can use this as part of a script to automatically get this information.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can also schedule a little piece of job control code rather than the job itself and have the job control do all the normal bits - attach, prepare, run, wait, check status. Afterwards, do whatever needs doing if the job aborts.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Do u mean I can get the job status immediately???
Can I check in the transform stage???


Thanks,

ArndW wrote:The UNIX level program "dsjob" will, with the correct options, give you the finish status of any job plus a lot of other information. You can use this as part of a script to automatically get this information.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

But I would like to know as soon as the job aborted.
So do u have any other idea???


Thanks,

chulett wrote:You can also schedule a little piece of job control code rather than the job itself and have the job control do all the normal bits - attach, prepare, run, wait, check status. Afterwards, do whatever needs doing if the job aborts.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

ICE,

there are different ways of getting a job's status and the 3 most common means have been touched upon in this thread:

1. Read it from the Director
2. Retrieve it from UNIX using the dsjob command
3. Retrieve it from insideDataStage using DSGetJobInfo().

None of these seem to work for you and I don't know why not. What are you trying to do, and where do you wish to have a job status value available?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ICE wrote:But I would like to know as soon as the job aborted.
So do u have any other idea???


Thanks,

chulett wrote:You can also schedule a little piece of job control code rather than the job itself and have the job control do all the normal bits - attach, prepare, run, wait, check status. Afterwards, do whatever needs doing if the job aborts.
ICE - that would be 'as soon as the job aborted'. The job aborts, ending immediately. The next line in the job control code notices and does whatever you need. Can't get sooner than that.

:!: You can't do stuff like this from inside the job - once it aborts it is done - you need to do your abort check post job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
gradkarthik
Participant
Posts: 28
Joined: Fri Jul 29, 2005 3:51 pm
Location: Arizona, USA

Post by gradkarthik »

Hi
You can write a subroutine to check the status of the job after the job has completed (DSGetJobInfo) and then depending on the status you can then use the DSSendMailTask to send you an email informing you ASAP if the job has failed or succeeded. (Refer to BASIC Manual).
You can run this subroutine as an After job subroutine from your job properties page.
Thats the fastest that you can get your information. This method is only suitable for less no of jobs. There are other methods for large no of jobs.
gradkarthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

gradkarthik wrote:You can run this subroutine as an After job subroutine from your job properties page.
No, you can't. :evil:
-craig

"You can never have too many knives" -- Logan Nine Fingers
gradkarthik
Participant
Posts: 28
Joined: Fri Jul 29, 2005 3:51 pm
Location: Arizona, USA

Post by gradkarthik »

My Bad..
I didnt see the version 4x :oops:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Make a batch containing the job and its checker job. Always run the batch. That way the checker job will be as immediate as possible in version 4.x. Aborts are immediate; nothing else in the job can be started once an abort condition has been signalled.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Ok.I am going to use batch file according to all of ur suggestions.

Thank u so much for all responses.


ICE. :)
Post Reply