Sequence job in loop getting aborted

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
bijojames
Participant
Posts: 12
Joined: Wed Nov 28, 2007 10:27 pm
Location: THANE

Sequence job in loop getting aborted

Post by bijojames »

Hi All
I am working with a job which should run in a loop for a particular time frame. Its running in loop. But when the end time exceeds the given time limit, the job gets aborted. Actually i want the job in finished ok state.
The warning before the fatal error which i got is
"JOB_JS..JobControl (@Job_Activity_65): Controller problem: Error calling DSRunJob(JS_Job2), code=-14
[Timed out while waiting for an event]"


The design which i have used is

Uservariable_Activity--------->Startloop_activity---->Job_Activity--------->Endloop_Activity

In the Uservariable_Activity stage, I used 3 variables
1.StartTime
2.EndTime
3.Counter

In the startloop_activity stage these variables were called


Somebody please give me a solution for this or help me with an alternate design for my requirement

Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Timeout waiting for a job to start may be (usually is) a symptom that something in the execution environment is overloaded - either processing capacity or network capacity are the usual suspects.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bijojames
Participant
Posts: 12
Joined: Wed Nov 28, 2007 10:27 pm
Location: THANE

Post by bijojames »

Hi

It will be great if anybody can give me an alternate design for the above job

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

Post by chulett »

For a decidedly bare-bones design, there's nothing wrong with it. It runs the job in a loop until the end condition for the loop is met. Now, unless that's a new feature of 8.x I don't see how the loop stages understand your 'Time' based user variables. Are they in internal format? Are they actually driving the loop? :?

I also don't see how the loop ending or 'exceeding the given time limit' would cause any kind of time out error. Is there more to the design, something after the End Loop stage? Is 'JS_Job2' in fact the job being run by the Job Activity stage inside your loop?

As noted, the -14 timeout simply means the system was overloaded at the time the 'run job' was issued, such that the job could not start within the time limit hard-wired into the software. May have nothing to do with your loop, it could just be a victim of whatever else was running at the time.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bijojames
Participant
Posts: 12
Joined: Wed Nov 28, 2007 10:27 pm
Location: THANE

Post by bijojames »

Hi
The value for the variables in the UserVariable_Activity stage given as follows
Starttime----->Iconv("11:42AM","MTS")
Endtime------>Iconv("11:45AM","MTS")
Counter------>1
These variables were called in the Startloop_Activity satge as follows
From------>Starttime
Steps----->Counter
To-------->Endtime
But the loop does not work inacordance with the time specification given.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your increment is one second. Therefore, the second iteration of the loop will fail to start the job if it hasn't finished within that second. Further, if the first iteration of the job hasn't finished within one minute, it will throw a -14 error (or, possibly, abort with "job not in a runnable state - already running" error).

Try changing your increment to slightly more than the run time (in seconds) of the loop of activities.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm going to go out on a limb and disagree with Ray. The loop has no idea that you think you are working with 'time' values - they are just numbers. In fact, those IConv statements translate to this:

From: 42120
Steps: 1
To: 42300

So you've got the same thing as if you had interated from 1 to 180. It doesn't wait until 11:42AM to start and doesn't end at 11:45AM, it starts right away and runs your job 180 times, over and over and quickly as it can. The step of one equates to one loop, not one second after all.

Unless version 8.x has magically made those stages time aware somehow. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No, there's no time awareness, but the Iconv() functions mean that you are working with seconds, at least conceptually. Yes, they're meaningless in the context of the loop, but fundamental to my explanation of why you might be seeing -14 errors being thrown.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bijojames
Participant
Posts: 12
Joined: Wed Nov 28, 2007 10:27 pm
Location: THANE

Post by bijojames »

Hi
So then how i will be able to run a loop job from a particular start time to end time. Please give me a solution
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

There is no builtin mechanism to do that. I would make a loop that runs through many iterations and then put a Execute Command or Routine Activity stage in which checks to see if the time condition has been reached, then branch and exit the loop.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

For start time, you'll either need to have your scheduler wait until the proper time to start or build a 'sleep until' routine that takes an argument time and based on the current time, sleeps the 'delta seconds' until then. Then enter the loop.

Inside the loop, you'll need another routine to check the current time against your desired end time, and when exceeded branch outside the loop.

Make sure your loop counter limit will support at least the number of iterations needed to reach your time limit. In other words, set it to a large number.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bijojames
Participant
Posts: 12
Joined: Wed Nov 28, 2007 10:27 pm
Location: THANE

Post by bijojames »

Can somebody help me to create a routine for the above purposes i.e to check the current time against the end the and acoordingly exit the loop when required...
Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What kind of help do you need? Like most things, there are many ways to skin this cat. One such...

1. Pass in a full ISO timestamp
2. Use the TimeDate() function to get the current date/time
3. Reassemble the output in ISO format
4. Directly compare the two strings

Or use whatever functions tickles yer fancy. Date() and Time() are available as are the system variables @DATE and @TIME. It's all in the online help.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply