After-job routine returned error: No error

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:

After-job routine returned error: No error

Post by Aquilis »

Hi all,
I am using an after job subroutine,which will trigger only when the job fails to execute sucessfully,for this i have unchecked the option 'Only run after jobsubroutine on sucessful completion of job',so it should work around the way.

but even then its firing a mail after sucessful completion of the job.Will it fire when job completes with any warnings.
My job has got the following warnings as:

'After-job routine returned error: No error'
I think its associated with the 'dssendmail_template.txt':server
so what would be the problem with this.

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

Post by ArndW »

That is not the way it works; if the routine is successful then it will execute the after-job, otherwise it won't execute the after-job routine.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Right. With that option unchecked, it will always run the after-job routine. Checked, it will only run when there are no errors in the job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

Thank you,

According to Andw, My routine is working perfectly then, since its firing/executing.

Chulett,
I think you might be right,it's checked 0r Unchecked my routine is firing.
but i am getting warning as :
'After-job routine returned error: No error'

and as part of information i am getting following things:

The following parameters in the call to DSSendMail were not mentioned in the file 'dssendmail_template.txt': server
---------------------------------------------------------------------------------------------

Actually our after job routine will in turn trigger two routines like
1. in buillt DSsendmailTester
2.Another Routine will Read a file and get the email ids for above dssendmail routine.

So Guyz, what would be the simple procedure to trigger a routine only when the job gets aborted.

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

Post by chulett »

I am right. :wink:

You really should use DSSendMail directly, not the 'Tester' version which just wrappers it. Build your own wrapper.

You can ignore the 'were not mentioned' part as that's normal for sendmail.

Search the forums for INTERIMSTATUS. It is a check you'll need to make in your routine to see what the actual status will be once the job actually finishes. If that check reveals the job will be aborting or otherwise not completing without error, then fire the rest of your routine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

Hi all,
I am trying get 'InterimStatus' of the job, and trying to fire after job routine to post the mail notification from that job itself. But my job is running continuously.so what would be the cause.
could you guyz suggest me what went wrong in my below routine.:


vToAddr = Field(Field(ArraySummary,'|',4),'=',2)
vFromAddr = Field(Field(ArraySummary,'|',5),'=',2)
vSmptServer = Field(Field(ArraySummary,'|',6),'=',2)
Subject = "aborted"
Body = "aborted"

*attach Job
JobHandle = DSAttachJob ('JOBNAME',DSJ.ERRWARN)
Status = DSGetJobInfo(JobHandle,DSJ.JOBINTERIMSTATUS)
If Status = DSJS.RUNFAILED or Status = DSJS.CRASHED or Status = DSJS.STOPPED or Status=DSJS.RUNWARN Then
ErrorCode=DSDetachJob(JobHandle)
ErrorCode = DSSendMailTester(vToAddr,vFromAddr,Subject,vSmptServer,Body)
End
Aquilis
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Don't attach in this case, use DSJ.ME as the job handle for the current job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

Chulett,

:oops:

Thank you, your suggestion with 'InterimStatus' worked out.Now i am able to get my expected result.

aquilis...
Aquilis
Post Reply