To pass job status to routine

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

Post by kduke »

Massimiliano

You need to check this in a controlling job. You cannot check the status in an after routine. The jobs is not done and if it aborts then it will not run the after routine.

Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you check execution status of a job from that job's after-job subroutine, the answer will always be "running".

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
you can get the job's status after it finishes in 2 ways:
1. if you run it in a sequencer job, you can branch the logic depending on job's status after it is done by simply connecting links to other stages and specifying the trigger action for each link.

2. write a batch job attach a handle to the desired job and use DSGetJobInfo function (search in designer's help) to get the status of that job.

Hope this helps,

Roy R.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Massimiliano

Roy is correct. You cannot check the status of a job in the job or in an after routine. You have to do it outside of that job in either a sequence or a batch job like Roy said. You can do what you want easily if you follow his advice. Tools like DataStage force you to do more steps than sometimes you may want. You can fight the tool or do it the recommended way and save yourself to trouble.

Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
Post Reply