How to make a after job routine which resets a server job

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
mgk
Participant
Posts: 2
Joined: Fri Jun 18, 2004 2:56 am

How to make a after job routine which resets a server job

Post by mgk »

Can anyone show me the code to a after job routine wich resets a server job after its finished, no matter the errorcode?

Regards
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard! :D

You can't reset the job itself from within an after-job subroutine because, while the after-job subroutine is executing, the status of the job is still "running". The job does not stop running until after the after-job subroutine returns. You can not reset a job if its status is "running".

Is that what you had in mind to do?

You can certainly reset an attached job from job control code, using DSRunJob() with a run-type argument of DSJ.RUNRESET. But not if the job is currently running.

What are you hoping to achieve here? Would it be as acceptable to reset the job if required just before running it the next time? From a job sequence this is one of the options in a Job Activity; how to do it in job control code has been discussed on this Forum. Search, perhaps, for DSJ.RUNRESET.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mgk
Participant
Posts: 2
Joined: Fri Jun 18, 2004 2:56 am

Post by mgk »

Hallo :lol:

Thanks for your answer, I think that I'm going to use the job sequence and then make it a "reset if required, then run" job.

Regards
Post Reply