Resetting a job

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Resetting a job

Post by Aquilis »

Hi all,

I am working on PX Edition, but In my Environment i dont have C++ compilers got installed.Whenever a parallel job gets aborted i try to reset it through user defined Routine before its execution.If a job gets aborted,i know that without a C++ compilers its impossible to compile the jobs involving Parallel Transformers.So if i go for resetting a Job instead of recompiling,will this do any sense or will this going to work out ?

Currently i cant test this one out,that's why i opened this thread.

Thanks,
Aquilis
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Resetting != compiling. You'll be fine simply resetting the job, unless there's something dodgy about your 'user defined routine' that does the reset. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

How are you starting your jobs? If from scripts then I have posted code which reset a job. It also checks to see if it needs it.

If you are doing it from a job then use DSPrepare().
Mamu Kim
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

Or use a Job sequencer that reset it automatically.
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

Jobs are executed through a JobControl and which itself does the Resetting and invocation of the parallel Jobs.So when we dont have the compilers installed on the environment and previous execution status of the jobs are Aborted,then JC will try to reset it and Run.so will it succeed in resetting and executing ? i think it will not happen unless all the jobs invoked from the JC are made as multi-instantiated jobs ?

Input needed.
Aquilis
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your last sentence is completely erroneous - whether or not a job is multi-instance enabled has no bearing whatsoever on whether it can be reset successfully. To be reset successfully a job must simply be not in a runnable state and contain no quirks that prevent its being reset. DSPrepareJob() - that is, "reset if required, then run" - will work, and does not require recompiling anything, and therefore does not require there to be a C++ compiler.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

Even though the job is in aborted state and if we try to reset it knowing that we dont have c++ compilers not installed,will it get reset and will execute properly ?

But in this regard, When i try to reset the aborted job ,I am facing the Error Messsage as :
" Unable to run job----2 "

But when i make the job as multi-instance job,even the job fails it will abort as the other instance job.So this was my conclusion before,if this not the problem,then what could be the other reasons which causes this error (" Unable to run job----2 ") ?

Guidance required,
Thanks,
aquilis
Aquilis
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Aquilis wrote:Even though the job is in aborted state and if we try to reset it knowing that we dont have c++ compilers not installed,will it get reset and will execute properly ?
Asked and Answered. More than once. Yes.
Aquilis then wrote:But in this regard, When i try to reset the aborted job ,I am facing the Error Messsage as : " Unable to run job----2 "
As noted earlier, you'd need to show us how you are resetting aborted jobs. Only then could we help understand where your 'error message' is coming from.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

When you reset the job, does its status change to "has been reset"?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

when i reset the Job,i do get status changed to 'Job has been Reset'.

The code i am using is as follows:

*Reset the Job if the job is not in the Runnable State.
ResetJobName = JobName
gosub ResetJob:

hJob3 = DSAttachJob(JobName, DSJ.ERRWARN)
If NOT(hJob3) Then
-----
-----
-----
-----
-----
Goto ExitReturnSub:
End

ResetJob:
********
hResetJob = DSAttachJob(ResetJobName, DSJ.ERRWARN)
If NOT( hResetJob) Then
----
----
----
End
ErrCode = DSSetDisableProjectHandler( hResetJob, @FALSE)
ErrCode = DSSetDisableJobHandler( hResetJob, @FALSE)

Result = DSGetJobInfo (hResetJob, DSJ.JOBSTATUS)
If (Result = DSJS.RUNFAILED) or (Result = DSJS.STOPPED) or (Result = DSJS.VALFAILED) Then
Result = DSRunJob(hResetJob,DSJ.RUNRESET)
ErrCode = DSWaitForJob(hResetJob)
End
* Release the handle for the job
ErrCode = DSDetachJob(hResetJob)
ResetJobName = ""
Return

ExitReturnSub:
***********
;

Thanks,
Aquilis
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

a) put in a call to DSLogWarn() when you reset the job to make sure it is being executed.

b) put in a call to DSWaitForJob() after the reset to give it time to complete.

c) Have you looked at DSPrepareJob()?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just use DSPrepareJob. No need to check ahead of time, if it needs to be reset it will reset it, otherwise it does nothing. Unless you have some need to log everything found: the current state, if it needed to be reset, etc.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Just a precautionary note with

Code: Select all

JobHandle = DSPrepareJob(JobHandle)

If it needs to reset the job it will return a new JobHandle. This is normally not an issue but sometimes you need to be aware of this; I had some job control where I stored the JobHandle in an array and this changing of handles caused a lot of problems since it looked like a sporadic bug.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yah, it does help to read the docs. :wink:
-craig

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