Page 1 of 1

Start Main Sequence from a particular Job/Sequence

Posted: Sat Feb 09, 2008 5:00 am
by wasimraja
Hi Guys,

I was wondering if there is an option in Datastage where you can run a main sequence from any sub-sequence or job. For a scenario, I have 100 jobs split into 10 sequences and all are designed to run serially in another Main sequence. Now, what if I want to start the Main sequence from the fifth sub-sequence under it, is there a way?

You can compare this to the "Start Workflow from Session" option in Informatica. ( I hope I got that right)

I did search for it but couldnt find the exact one which I was looking for or may be I was too hasty. If you find my questions have been answered already, please do point me to the solution.

Your time is greatly appreciated.

Posted: Sat Feb 09, 2008 5:03 am
by ArndW
I'm not quite sure what the direction of the question is.

You can start any DataStage job from any sequence use the Job Activity Stage, and you can also start any DataStage job from another job using either the builtin BASIC functions (DSAttachJob(),DSRunJob(), etc.) or through executing a shell "dsjob" command.

Posted: Sat Feb 09, 2008 5:17 am
by wasimraja
Hi AndrW,

Thanks for the reply.

Let me try clearing my question one more time.

I have two sequences S1 and S2 each of them containing jobs J1 and J2 respectively.
I have another sequence M1 where the sequences S1 and S2 are placed and designed to run in serial. Now, if I run the M1 sequence, the sequence S1 runs first and then the sequence S2 runs.

Now, if I wanted to run the M1 sequence but I dont want the S1 sequence to be ran and instead start from the sequence S2 directly (skip S1 sequence). Is there a way to do this.

I hope I am a bit more clear this time.

Posted: Sat Feb 09, 2008 5:20 am
by ArndW
The simplest way is to add a parameter to M1 such as "SkipS1" and use that to skip executing the Job Activity in the M1 sequence.

Posted: Sat Feb 09, 2008 5:32 am
by wasimraja
Thanks again.

So, I assume there is no inbuilt mechanism where you can simply start from any sequence as you like. Since its the simplest way, is there a better way of doing this which is more easier to maintain. I have about 400 jobs and 60 odd sequences and I am not sure if I can use the current run date and the skip parameter value to determine whether to skip it or not. Or I may just have to create 60 parameters instead.

Posted: Sat Feb 09, 2008 6:01 am
by ArndW
There are various ways to achieve this. No tool can do this without knowing the "rules" and you haven't specified how you wish to do this. Are the rules based on some table? If they are based on successful completion of previous runs, then I recommend you read the documentation on DataStage restartability, as this might solve your problem without having to resort to any other logic.

Posted: Sat Feb 09, 2008 6:46 am
by wasimraja
I already am using the restartability feature in the sequences. I have a main sequence and sometimes, I would be required to skip a few set of sequences under it and start from the third sub-sequence. The only way I can do this now is by running the sequences one by one in order skipping those unnecessary ones. The only problem is that I dont skip the same set of jobs everytime but varies depending on the situation. So, I was wondering if there was any such feature where you can start a particular sequence from any point of it. The only way I see it achievable is by changing the design of the existing sequences so that it is easier to handle such scenarios. (or probably try to avoid these situations).

I had worked on Informatica and there is a feature called "Start Workflow from Task" option where you can start a workflow from a particular worklet/task which makes skipping any previous jobs much easier. so, I wanted to know if there is such an inbuilt feature available.

Again, thanks for your reply.

Posted: Sat Feb 09, 2008 8:21 am
by chulett
As Arnd has already noted - no, there is no such 'inbuilt feature' available so no need to keep asking. Unless you code something else, they start from the beginning each time unless you use the checkpointing option and jobs are aborted. If you needed variable start points in your Sequence jobs, that should have been coded in from the beginning.

Why not cosider building different 'main' Sequence jobs, one for each of these situations you think you'll need? Bit of a kludge, but rather simple to grind out and use. How many 'mains' do you have?

If you were using your own job control (as we do) rather than Sequence jobs then something like this could be fairly simple. We swap job hierarchy configuration files at runtime via Control-M to vary the specific jobs run, for example. Or, I've heard tales of deep hackers manipulating the checkpoints outside of a Sequence job before it starts to simulate an aborted state and arrange for it to start at the 'task' they desire. Could only be urban legend for all I know.

Worst case, build parameters into each main Sequence to branch into it at various points. Rather simple to implement and use, just monkey work to grind them out.

Posted: Sat Feb 09, 2008 3:42 pm
by wasimraja
I understand. Thanks for the replies.

Posted: Wed Feb 13, 2008 10:35 pm
by veera24
ArndW wrote:I'm not quite sure what the direction of the question is.

You can start any DataStage job from any sequence use the Job Activity Stage, and you can also start any DataStage job from another job us ...
Could u pls explain how to start any DS job from another job?

Posted: Wed Feb 13, 2008 11:21 pm
by ray.wurlod
U hasn't logged in for quite a few months. Don't hold your breath waiting for U to explain how to start any DS job from another.