DSAttachJob

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
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

DSAttachJob

Post by myukassign »

I have a Job JobA which is in aborted status.

I am having a controller job JobB where I am trying to attach JobA to reset it and run using

hJob1 = DSAttachJob("JobA", DSJ.ERRFATAL)

But it is throwing me exception that the job is not in the run mode. Can anyonehelp whet need to be done? I want to run JobA from controler job no matter what it is in abort or not abort status.
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Post by myukassign »

In another way.

Can we attach an aborted job using DSAttachJob() ?

If it is not possible what is the alternative for that. I want to run the job from a controller job , no matter waht the status of this job
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Of course you can attach to an aborted job, and the code you posted does just that and nothing more. You'd need to take an extra step to reset an aborted job before attempting to run it and it sounds like you're not doing that.

As noted in other replies to you, you can use the DSPrepareJob function for that - it performs the "Reset if required" functionality. After that completes, then run the job like normal.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply