StartLoop

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
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

StartLoop

Post by Raftsman »

I setup a StartLoop sequence as follows

StartLoopA => JobA =>Endloop

I wanted to use the UserStatus to control the loop.

If UserStatus = 1 end loop => Send EMail

If User_Status = 2 endloop => Terminate sequence

If UserStatus = 3 continue loop until one of the above or LoopLimit reached

I can't get this to work. It seems like the Loop works by Job Fail and Job Complete.

Has anyone used the UserStatus to control the flow or does it only work as the documentation suggests, Success and Fail.

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

Post by chulett »

How are you 'ending the loop'? If you need to Terminate, just branch directly to a Terminator rather than trying to get out of the loop gracefully and then terminate. Same for the email - send it then terminate, all while still "inside" the loop. It won't mind. Much. :wink:

You could also branch outside the loop to another stage (Sequencer, typically) that follows the EndLoop and thus effectively end the loop, then go on and decide how you got there and what you needed to do next.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

To resolve my problem, I put the Exception abort outside the loop. For the email my condition are UserStatus = 1 else OTHERWISE. This seem to fix the problem. Not sure why.
Jim Stewart
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

Uh, did you put USER_STATUS, or USERSTATUS?
Post Reply