ROUTINE FAILING
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 35
- Joined: Thu Aug 11, 2005 5:21 pm
ROUTINE FAILING
Routine is working in one job and not working in another . Help me to resolve this.
SEQ_J_Stage_PS_S_BUS_UNIT_FS_HCM_test..JobControl (@GetNextBatchNumber): Routine DSU.GetNextBatchNumber did not finish OK, return code = '277'
is the error message.
It is working in other jobs.
SEQ_J_Stage_PS_S_BUS_UNIT_FS_HCM_test..JobControl (@GetNextBatchNumber): Routine DSU.GetNextBatchNumber did not finish OK, return code = '277'
is the error message.
It is working in other jobs.
Last edited by srinivenigalla on Fri Jul 13, 2007 11:42 am, edited 1 time in total.
-
- Participant
- Posts: 35
- Joined: Thu Aug 11, 2005 5:21 pm
ROUTINE of EPM9.0 for getting Next batch number
It is used in all the sequences before the actual process is ran.Is this information sufficient
-
- Participant
- Posts: 35
- Joined: Thu Aug 11, 2005 5:21 pm
-
- Participant
- Posts: 35
- Joined: Thu Aug 11, 2005 5:21 pm
NO NEED TO SHOUT, I MAY BE OLD BUT NOT DEAF. YET.
I find that hard to believe, but ok. So, you saying that '277' is not the next batch number and your Sequence job does not automatically handle failures? That property is not checked in the job?
You see, when that option is turned on and a routine does not return a zero, it is considered to have failed and the Sequence job logs a message that looks just like that one. Perhaps you might want to double-check. And why would your 'next batch' routine return an 'old' number? Perhaps you should post your routine code as well.
I find that hard to believe, but ok. So, you saying that '277' is not the next batch number and your Sequence job does not automatically handle failures? That property is not checked in the job?
You see, when that option is turned on and a routine does not return a zero, it is considered to have failed and the Sequence job logs a message that looks just like that one. Perhaps you might want to double-check. And why would your 'next batch' routine return an 'old' number? Perhaps you should post your routine code as well.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 35
- Joined: Thu Aug 11, 2005 5:21 pm
Sorry, I am not shouting , it is typo mistake. Hope this gives you clear idea.
$INCLUDE DSINCLUDE JOBCONTROL.H
Deffun GetNextVal(A) Calling "DSU.KeyMgtGetNextValueConcurrentBATCH"
IF CurrentBatchNum = 0 THEN
* generate a batch number
GeneratedBatchID = GetNextVal(GlobalBatchName)
JobName = DSJobName
UserName = @LogName
StartTimestamp = DSJobStartTimestamp
* Setup J_Load_BATCH_INFO, run it, wait for it to finish, and test for success
hJob1 = DSAttachJob("J_Load_BATCH_INFO", DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: SEQInfoJob", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "GeneratedBatchID", GeneratedBatchID)
ErrCode = DSSetParam(hJob1, "JobName", JobName)
ErrCode = DSSetParam(hJob1, "UserName", UserName)
ErrCode = DSSetParam(hJob1, "StartTimestamp", StartTimestamp)
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: J_Load_BATCH_INFO", "JobControl")
End
DetachError = DSDetachJob (hJob1)
Ans = GeneratedBatchID
END
ELSE
Ans = CurrentBatchNum
END
$INCLUDE DSINCLUDE JOBCONTROL.H
Deffun GetNextVal(A) Calling "DSU.KeyMgtGetNextValueConcurrentBATCH"
IF CurrentBatchNum = 0 THEN
* generate a batch number
GeneratedBatchID = GetNextVal(GlobalBatchName)
JobName = DSJobName
UserName = @LogName
StartTimestamp = DSJobStartTimestamp
* Setup J_Load_BATCH_INFO, run it, wait for it to finish, and test for success
hJob1 = DSAttachJob("J_Load_BATCH_INFO", DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: SEQInfoJob", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "GeneratedBatchID", GeneratedBatchID)
ErrCode = DSSetParam(hJob1, "JobName", JobName)
ErrCode = DSSetParam(hJob1, "UserName", UserName)
ErrCode = DSSetParam(hJob1, "StartTimestamp", StartTimestamp)
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: J_Load_BATCH_INFO", "JobControl")
End
DetachError = DSDetachJob (hJob1)
Ans = GeneratedBatchID
END
ELSE
Ans = CurrentBatchNum
END
Your message obviously isn't coming from this routine. As for whether it returns the 'current' or 'generated' batch number there's no way for me to know and it doesn't really matter. I'm just going to repeat what I've said before and then leave it at that.
When a Routine Activity stage does not return a zero result, and the controlling Sequence job has the Job Properties / General / Compilation option of 'Automatically handle activities that fail' enabled, it will log a warning just like yours. I don't know of any other way your message would have been logged.
When a Routine Activity stage does not return a zero result, and the controlling Sequence job has the Job Properties / General / Compilation option of 'Automatically handle activities that fail' enabled, it will log a warning just like yours. I don't know of any other way your message would have been logged.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 35
- Joined: Thu Aug 11, 2005 5:21 pm
-
- Participant
- Posts: 35
- Joined: Thu Aug 11, 2005 5:21 pm
You are missing an important point. Your routine is not failing, at least not in any obvious manner or you would be seeing some of your coded "JobControl" LogFatal messages. Your Sequence job considers it to have failed and treats it as such because of the non-zero return code. That's all.
You need to tweak your triggers so it knows a non-zero return is ok, something which is documented in the online help.
You need to tweak your triggers so it knows a non-zero return is ok, something which is documented in the online help.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers