Page 1 of 2

job sequence

Posted: Thu Jun 14, 2007 10:25 am
by attu
I have 4 jobs and after each job completes i need to run a script , i need to know whether i can use before after sub routine in each job or in the job sequence i can use execute command stage.

Thanks all

Posted: Thu Jun 14, 2007 10:31 am
by chulett
Yes.

Posted: Thu Jun 14, 2007 10:35 am
by attu
Craig,
Thanks for your prompt reply

So I should use an after job sub routine at the job level. right?

is it a best practice ?

Posted: Thu Jun 14, 2007 10:40 am
by chulett
Either one can work, it's your call. Me, I'd prefer it be a discrete step in the Sequence job, each Job Activity stage would have a trailing Execute Command stage.

Posted: Thu Jun 14, 2007 11:01 am
by attu
thnx Craig,

for every job activity stage i have routine activity stage attached and an execute command stage attached, but the next job in the sequence should only run when the script in the execute command stage finishes ...how would i accomplish this?

any suggestions

thanks

Posted: Thu Jun 14, 2007 2:01 pm
by dspxguy
OK conditional trigger in COMMAND EXEC ACTIVITY .

Posted: Thu Jun 14, 2007 4:07 pm
by chulett
Exactly. One of them between the EC stage and the next JA stage. And make sure your script passes back a non-zero exit status if something goes wrong in it, otherwise your next job will always think it ran ok and things will not stop.

Posted: Fri Jun 15, 2007 9:25 am
by attu
Thanks for the help,

The script will load data into a table which will be used by the next job, in that case after the script finishes running and moves on to the next job and if the table is still being loaded. How will it affect the next job?
Any thoughts on this


Thanks

Posted: Fri Jun 15, 2007 11:26 am
by JoshGeorge
Preempt such a situation. Make sure your script does not return its control back to datastage without completing what it is meant to (ie. loading complete data into respective table). If you have linked stages in sequential order, sequence will move from one stage to next only in that order and also only after the current stage finishes.
attu wrote: The script will load data into a table which will be used by the next job, in that case after the script finishes running and moves on to the next job and if the table is still being loaded. How will it affect the next job?

Posted: Fri Jun 15, 2007 1:46 pm
by chulett
First thought... Why use a script to 'load data into a table', isn't that what you bought this fancy ETL tool for? Why not use a job? :?

Posted: Fri Jun 15, 2007 2:03 pm
by attu
Craig I dont know why they are using script. :(


In the end of my final job activity after the job is processed and runs a script from the command execute stage and after that it goes to routine activity stage for job status.

How will I end the whole sequence after all jobs have ran successfully?
can i use end loop activity stage?

Posted: Fri Jun 15, 2007 2:12 pm
by sun rays
If you are not going to do any iterations then do nothing. The sequence automaticaly stops after the last activity.

Posted: Fri Jun 15, 2007 2:17 pm
by mystuff
Craig I dont know why they are using script
What's your database?

Posted: Fri Jun 15, 2007 2:22 pm
by attu
sun rays wrote:If you are not going to do any iterations then do nothing. The sequence automaticaly stops after the last activity.
So after routine activity stage no out put link....

Mystuff it's Netezza

Posted: Fri Jun 15, 2007 6:58 pm
by JoshGeorge
You can put a Sequencer stage in the end with mode set to 'All' and fill in the 'Logging Text'.