Reset a Job from a TRANSFORMER

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
MT
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 09, 2007 3:51 am

Reset a Job from a TRANSFORMER

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

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

Post by ray.wurlod »

Prevention is better than cure. Write jobs that don't abort in the first place.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post 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.
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post 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.
Regards,
S. Kirtikumar.
Post Reply