Start Main Sequence from a particular Job/Sequence

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
wasimraja
Participant
Posts: 61
Joined: Fri Jul 06, 2007 4:23 pm
Location: USA

Start Main Sequence from a particular Job/Sequence

Post 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.
Cheers
Wasim

--If necessity is the mother of invention, then the need to simplify is the father of it.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
wasimraja
Participant
Posts: 61
Joined: Fri Jul 06, 2007 4:23 pm
Location: USA

Post 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.
Cheers
Wasim

--If necessity is the mother of invention, then the need to simplify is the father of it.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
wasimraja
Participant
Posts: 61
Joined: Fri Jul 06, 2007 4:23 pm
Location: USA

Post 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.
Cheers
Wasim

--If necessity is the mother of invention, then the need to simplify is the father of it.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
wasimraja
Participant
Posts: 61
Joined: Fri Jul 06, 2007 4:23 pm
Location: USA

Post 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.
Cheers
Wasim

--If necessity is the mother of invention, then the need to simplify is the father of it.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
wasimraja
Participant
Posts: 61
Joined: Fri Jul 06, 2007 4:23 pm
Location: USA

Post by wasimraja »

I understand. Thanks for the replies.
Cheers
Wasim

--If necessity is the mother of invention, then the need to simplify is the father of it.
veera24
Premium Member
Premium Member
Posts: 150
Joined: Thu Feb 07, 2008 9:37 pm
Location: NewYork

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply