Sequencer status inside another sequencer
Moderators: chulett, rschirm, roy
Sequencer status inside another sequencer
Hi,
I need to run 5 sequencers and I schedule all these under run director daily. But there is no control of one sequencer over another. I want to kickoff last sequencer if only first 4 sequencers run successfully. I scheduled sequencers like below.
Sequencer 1 - 02:00 am
Sequencer 2 - 03:30 am
Sequencer 3 - 04:45 am
Sequencer 4 - 05:00 am
Sequencer 5 - 06:45 am
Sequencer 5 has to run if sequencer 1 to 4 run successful. Please suggest me a way to achieve this.
Thank you,
I need to run 5 sequencers and I schedule all these under run director daily. But there is no control of one sequencer over another. I want to kickoff last sequencer if only first 4 sequencers run successfully. I scheduled sequencers like below.
Sequencer 1 - 02:00 am
Sequencer 2 - 03:30 am
Sequencer 3 - 04:45 am
Sequencer 4 - 05:00 am
Sequencer 5 - 06:45 am
Sequencer 5 has to run if sequencer 1 to 4 run successful. Please suggest me a way to achieve this.
Thank you,
Bhanu
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Sequencer status inside another sequencer
No you don't. You need to run five sequences.bond88 wrote:I need to run 5 sequencers
A Sequencer is something you use within a Sequence to bring flows of logic together - it has the big blue arrow and three "lights" as its icon.
Indeed, a Sequencer may hold your solution. In your master sequence, which runs these five sequences using Job activities, take Success triggers from the first four into an "All" Sequencer, and the fifth sequence is downstream of that.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Would have gone that route except for the time component to the scheduling. Hence the suggestion to have the Sequence job that runs last at 6:45am first check the status of the other four to see if (when it runs) if it needs to actually do anything or just shut down and wait for next time.
Me, I'd probably have it send out an email saying it couldn't run due to failures in the previous jobs rather than doing literally nothing, although that is certainly an option.
Me, I'd probably have it send out an email saying it couldn't run due to failures in the previous jobs rather than doing literally nothing, although that is certainly an option.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I bet the time of the scheduals is derived from the need to sequence them one after the other.
By the way, if your using any schedualer (organization wide) you can also define those dependancies there.
IHTH,
By the way, if your using any schedualer (organization wide) you can also define those dependancies there.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Just one routine at the start of the final Sequence. Look into the DSGetJobInfo function with an InfoType of DSJ.JOBSTATUS, one call for each of the previous four Sequence jobs. Each should return DSJS.RUNOK for the routine to pass back an "Ans" that you would check in the attached trigger.
Other functions you'll need (they're all in the link above):
DSAttachJob
DSAttachJob
I'd suggest passing back a 0 if all JobInfo calls return "ran ok" (which will be seen as success) or a 1 if any of them fail, which will be seen as a "failure" of the routine. Or you can pass back a 'Y' or 'N', whatever works for you. Good result back? Move on to the rest of the steps. Bad result? End the Sequence or perhaps send out an email that it couldn't run.
Other functions you'll need (they're all in the link above):
DSAttachJob
DSAttachJob
I'd suggest passing back a 0 if all JobInfo calls return "ran ok" (which will be seen as success) or a 1 if any of them fail, which will be seen as a "failure" of the routine. Or you can pass back a 'Y' or 'N', whatever works for you. Good result back? Move on to the rest of the steps. Bad result? End the Sequence or perhaps send out an email that it couldn't run.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
An exact search here for "dsgetjobinfo" and/or "dsj.jobstatus" should turn up code samples you can steal as a starting point.
For example, here. Cherry pick the parts out of that and/or other posts and put some effort into getting something together you think is close. Post your resulting code here and we'll take a look at it.
For example, here. Cherry pick the parts out of that and/or other posts and put some effort into getting something together you think is close. Post your resulting code here and we'll take a look at it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Yes, you would create a custom routine and then use a Routine Activity stage in the last Sequence job to run it... first. Depending on what it returns, you either execute all the stuff you have in there now (whatever that is) or do nothing.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact:
This may just be me but I consider routine writing an essential skill needed by a DataStage developer. But then so is knowing when to use a Server job for something.
This would be pretty simple as far routines go so (IMHO) a good place to start the learning ball rolling.
This would be pretty simple as far routines go so (IMHO) a good place to start the learning ball rolling.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi Craig,
I designed a server routine with type: Transform_function and in the code section I wrote below code
$INCLUDE DSINCLUDE JOBCONTROL.H
handle=DSAttachJob (Arg1,DSJ.ERRFATAL)
if handle <> 0 Then
jobName=DSGetJobInfo(handle,DSJ.JOBNAME)
jobStatus=DSGetJobInfo(handle,DSJ.JOBSTATUS)
Ans=jobStatus
End
and when I run this routine it is asking arguments and when I gave 4 sequencer names as arguments in 4 lines it is returning 1 in all rows. Now how can I implement this in 5th sequencer. Please advise me.
Thank you,
I designed a server routine with type: Transform_function and in the code section I wrote below code
$INCLUDE DSINCLUDE JOBCONTROL.H
handle=DSAttachJob (Arg1,DSJ.ERRFATAL)
if handle <> 0 Then
jobName=DSGetJobInfo(handle,DSJ.JOBNAME)
jobStatus=DSGetJobInfo(handle,DSJ.JOBSTATUS)
Ans=jobStatus
End
and when I run this routine it is asking arguments and when I gave 4 sequencer names as arguments in 4 lines it is returning 1 in all rows. Now how can I implement this in 5th sequencer. Please advise me.
Thank you,
Last edited by bond88 on Thu Sep 26, 2013 2:57 pm, edited 1 time in total.
Bhanu
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Or just one. I for one see no need for this to be any kind of 'generic' routine that you call four times. In your shoes I would have one dedicated routine that (one after the other) checks all four by name and then decides what to pass back based on the result. Did all four run successfully? Pass back your 'go' condition, whatever you decide that should be. One or more did not run successfully? Return your 'do not go' condition.
As to your question and regardless which design you use - call it first and have a trigger that checks for whatever success looks like running to the next (formerly first) activity, in your current design that sounds like it would be four success results strung together. If all you need to do is NOT run anything when there are failures, that's all you need - the routine will run but nothing else will and the fifth sequence will simply end. If you need to do something - abort, email - when there are failures, add another trigger with an Otherwise condition to catch that.
As to your question and regardless which design you use - call it first and have a trigger that checks for whatever success looks like running to the next (formerly first) activity, in your current design that sounds like it would be four success results strung together. If all you need to do is NOT run anything when there are failures, that's all you need - the routine will run but nothing else will and the fifth sequence will simply end. If you need to do something - abort, email - when there are failures, add another trigger with an Otherwise condition to catch that.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers