Routine activity failing in sequence

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Routine activity failing in sequence

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

Post 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"
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

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

Post 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?
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post 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 :?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

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

Post by ArndW »

ArndW wrote:...Could you please post your log entries with the complete error message?
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

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

Post 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,
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply