process control in sequencers

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
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

process control in sequencers

Post by Rob4732 »

Hello Everyone,

I have a master sequencer that calls a child sequencer:

Master Seq -> Activity1 -> Child Seq -> Activity2 -> Activity3

In my child sequencer I am checking a condition and if true I branch to an Email stage and no other activities run in the child sequencer. However control returns to the master sequencer and then Activity2 and 3 run there(which I don't want - I want the parent sequencer to stop also - when condition is met in child sequencer).

Not sure if this can be done in DS.

Any help is appreciated.

Thanks

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

Post by chulett »

Welcome!

One 'condition' that you could set in the child sequence would be for it to log a warning (use UtilityWarnToLog) when this email is sent and nothing else should run. The trigger from the Child Seq to Activity2 could check that and not run Activity2 and Activity3 in that case. However, you may not like the whole 'warning' part.

Another solution would be a routine that writes a value to the USERSTATUS area of the Child sequence job, one value for 'carry on' and another to 'stop the presses' depending on your condition. The trigger could then easily check ChildSeq.$UserStatus and only continue down when the appropriate value is found there. Search here for SetUserStatus to find the very simple routine you could leverage for this.

Yet another solution would be more Old School and involves dropping a flag or semiphore file to disk, with either the filename being significant or the contents. Then an Execute Command or Routine Activity stage between the Child Seq and Activity2 stages could check the filename / cat the file and branch (again in the trigger) based on what you found.

Me, I'd probably go the UserStatus route and make sure it was clearly annotated on the canvas. :wink:
-craig

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