Page 1 of 1

Routine activity failing in sequence

Posted: Wed Oct 23, 2013 3:27 am
by DSRajesh
Dear All,

I am using the below routine in job sequence using routine activity which is added after sequencer which will have links multiple jobs for failed notifications.when ever adding this rouine activity there is an executing command activity which is calling a datastage job is failing and totally sequence is failing.

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H 
JobName = FIELD(Arg1,"|",1) 
evtMessage1 = "" 
hJob1 = DSAttachJob(JobName, DSJ.ERRNONE) 
latestID = DSGetNewestLogId(hJob1,DSJ.LOGFATAL) 
For eventID = latestID To 1 Step -1 

         eventDetail = DSGetLogEntry(hJob1,eventID) 
         evtMessage = FIELD(eventDetail,"\",4) 
         evtType = Field(eventDetail,"\",3)   
          
         If evtType = "3" Then 
            evtMessage1 = evtMessage:"|":evtMessage1 
         END 

Next eventID 

Ans = evtMessage1 

Please suggest me where to use this routine activity in the sequence and why am i not able call the job with execute command activity stage.

Posted: Wed Oct 23, 2013 3:39 am
by ArndW
What is your error message? This routine will return a string, and if you haven't checked the job sequence option "Automatically handle activities that fail" and "log warnings after activities that finish with status other than OK"

Posted: Wed Oct 23, 2013 3:45 am
by DSRajesh
Arndw,

when i test this routine it returns the fatal error when ever job aborts otherwise returns empty string.

also the options which you specified are not checked.

do i have to check these two options?

Posted: Wed Oct 23, 2013 4:37 am
by ArndW
No, those two options should not be checked in your job.

Could you please post your log entries with the complete error message?

Posted: Wed Oct 23, 2013 6:30 am
by priyadarshikunal
If the return value is not zero then it is treated as failure and if those two options are checked then It will make the sequence abort.

I generally call such routine inside user variable activity, handle exceptions in Nested condition stage and gracefully stop if required.

Still you have not posted the error message,Are we supposed to read your mind and provide the answer :?

Posted: Wed Oct 23, 2013 9:55 am
by DSRajesh
Arndw,

Routine activity return log entries are :

01:12:36: Routine_Activity_212 (ROUTINE DSU.rtneventrmsg) started
01:12:36: Routine_Activity_212 finished, reply=
there is no reply code specified in the log.

I removed routine activity and called the routine in user variable activity .

I connected the user variable with sequencer which is having the links from different jobs with failed conditions and when i ran the job it keeps on running for an hour.

Could you please suggest me here .

Posted: Thu Oct 24, 2013 1:08 am
by ArndW
ArndW wrote:...Could you please post your log entries with the complete error message?

Posted: Thu Oct 24, 2013 5:43 am
by prasson_ibm
Hi,

I am also using same kind of routine to log a failed event notification.

I dont understand exactly what you are trying to do.I will explain what i am doing in my sequence.

In my sequence i call first Job and once it is failed i call another generic job where i pass this routing with failed job name as a parameter and generic creates xml later this xml is loaded into queue.

Lets say if PAYLOAD is parameter defined in generic job,value defined in sequence is

PAYLOAD=LogFatal"(Failed job Name)

Posted: Thu Oct 24, 2013 1:41 pm
by ray.wurlod
A routine that returns a non-zero value will trigger the automatic "error" handler in a sequence. Add an explicit Failure trigger to bypass this handling,