Page 1 of 1

Reset a Job from a TRANSFORMER

Posted: Mon Feb 23, 2009 7:15 am
by MT
Hi,

I searched the forum but I could not find a satisfying answer to following problem:

I run DataStage jobs with UtilityRunJob from a transformer but I run into problems if previous jobs (which where started via UtilityRunJob) aborted.
How can I reset a job from my TRANSFORMER stage (not from a script etc.) before "rerunning" it with UtilityRunJob?

Thanks in advance
MT

Posted: Mon Feb 23, 2009 7:28 am
by ArndW
Although technically one can call a user-defined routine in a transform stage (either once as a before/after or for each row) that in turn can reset another job, it doesn't make sense to do so and I think that you should look at your design again.

A transform is called once a job is started, so in order to reach the transform the job must already have been reset; in addition you cannot reset a job that is running so it does sound like a catch-22 condition unless I have misunderstood what you are trying to do.

If you explain what you are attempting, perhaps someone could come up with a suggestion on how to do this correctly.

Posted: Mon Feb 23, 2009 2:23 pm
by ray.wurlod
Prevention is better than cure. Write jobs that don't abort in the first place.

Posted: Tue Feb 24, 2009 1:09 am
by sachin1
As said earlier by Andrw and Ray, you can use a before job subroutine and code
ErrCode = DSRunJob(JobHandle , RunMode)
DSJ.RUNRESET Job is to be reset.

Reading help topics on DSRunJob can give you more idea.

Posted: Tue Feb 24, 2009 4:20 am
by Kirtikumar
Another option is create your own version of UtilityJobRun. In it, get the status of the job before calling DSRunJob. If needed, run the reset command for the job.