Switching between sequence and job
Moderators: chulett, rschirm, roy
Switching between sequence and job
I need to run a Job from sequence.Then inside the Job, I derive a few columns based on which I need to fire different jobs.
Can I set some User variable inside a job then access them from the sequence.How to do that ?
Can I set some User variable inside a job then access them from the sequence.How to do that ?
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
When you say you want to start a job (say 'X') from a sequence(say 'Seq_A'). You can do this only when your job ('X') is a sequence. So, you can call a sequence or a job from a sequence. But, Datastage doesn't have any stage (in server or parallel edition) which will call a job from a Parallel/server job.
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
You need some way for the job to stash / land that data in such a way that the Sequence job can pick up and pass along. For a Server job I'd suggest USERSTATUS, however either job type can write data to a flat file and a Sequence routine can pick them up and pass them as job parameters to downstream jobs.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Land them. A routine can then build the delimited list that the UserVariables and/or Start Loop stages are looking for. Perhaps by something as simple as cat'ing them to standard out and capturing that output. You could also use a function like Convert() to flatten the dynamic array into a comma delimited list. Many ways to skin this cat.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
This seems simple to me, I hope I am not missing anything.mydsworld wrote:Here is my requirement :
I have a sequence MySeq that has job J1.
Now J1 produces N records (each containing say 5 columns)
Now based on each record column value, I need to call different jobs say J2,J3 etc in the sequence MySeq.
How to impplement that.
My assumption is that you would know beforehand what jobs J2,J3 .. are.
For now let's say that job J1 generates data which can be potentially be processed by jobs J2, J3, J4 (based on your column which decides the job)
Design your job J1 in such a way that it creates three datasets after passing the last output link through a transformer and then to three datasets(say J2.ds, J3,ds, J4.ds). These three links can be constrained in such a way that only the records that have to go to job J3 go to J3.ds. After this you just have to connect these four jobs through a sequence. You can trigger jobs J2,J3,J4 simultaneously after J1 finishes successfully.
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
If you want to call different jobs from the current processing job (i.e. J1) try:
Server Job: Write a small routine which will just attach and run the job.
Parallel Job: Try External Filter with dsjob command or try a parallel routine.
Server Job: Write a small routine which will just attach and run the job.
Parallel Job: Try External Filter with dsjob command or try a parallel routine.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
But i feel that this suggestion would result,Minhajuddin wrote:For now let's say that job J1 generates data which can be potentially be processed by jobs J2, J3, J4 (based on your column which decides the job)
Design your job J1 in such a way that it creates three datasets after passing the last output link through a transformer and then to three datasets(say J2.ds, J3,ds, J4.ds). These three links can be constrained in such a way that only the records that have to go to job J3 go to J3.ds. After this you just have to connect these four jobs through a sequence. You can trigger jobs J2,J3,J4 simultaneously after J1 finishes successfully.
1. Unwanted creation of datasets. (in every run two unwanted datasets)
2. Unwanted execution of the rest of the Jobs.
I suppose that chulett had given enough solution for this problem.
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
I don't know about others, But, If I find a simple way to solve a problem, I would rather go with that solution instead of using a Rube Goldberg kind of solution. Moreover the OP has not mentioned that the data to be processed is mutually exclusive.ag_ram wrote: But i feel that this suggestion would result,
1. Unwanted creation of datasets. (in every run two unwanted datasets)
2. Unwanted execution of the rest of the Jobs.
I suppose that chulett had given enough solution for this problem.
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>