Problem while looping

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
wasimraja
Participant
Posts: 61
Joined: Fri Jul 06, 2007 4:23 pm
Location: USA

Problem while looping

Post by wasimraja »

Hi Guys,

I have a restartable sequence "SEQA" which runs a windows batch command using "Execute Command Activity Stage". The batch command is set to return 0 incase of success and 1 incase of failure. If it returns 0, an success email notification is set up. If it returns any other value, it is linked to a failure email notification and then a Terminator which would "Abort without sending Stop requests".

I have another restartable sequence "SEQB" which contains the "SEQA" inside the start and end loop stages. This loop is set to run 5 times only when the "SEQA" fails. Else the control is passed to an "SEQBSuccess" email notification and the loop is exited.

I delete the source file that the SEQA has to copy to see how it works.

First Iteration, SEQB calls SEQA. SEQA fails as it is unable to find the source file. The failure email for SEQA is sent.

Second Iteration, SEQB calls SEQA. The log file for SEQA shows that the job had failed the second time also and it goes to Aborted/restartable status. But, the log file for SEQB still shows that "Waiting for job SEQA to start".

It keeps waiting for couple of minutes and finally throws the below error message and goes to Aborted/Restartable status and doesnt execute the loop anymore as it is aborted.

Error calling DSRunJob(SEQA), code=-14
[Timed out while waiting for an event]

Another strange thing I noticed is that the SEQB sends the "SEQBSuccess" email before aborting. By this, I guess the "SEQA" returns a status which is something other than "Execution Failed" and hence the email is triggered.

Can someone please let me know what could be the possible reason for this behaviour and how to trace it out.

Your help is greatly appreciated.[/img]
Cheers
Wasim

--If necessity is the mother of invention, then the need to simplify is the father of it.
Post Reply