job sequence

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

attu
Participant
Posts: 225
Joined: Sat Oct 23, 2004 8:45 pm
Location: Texas

job sequence

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
attu
Participant
Posts: 225
Joined: Sat Oct 23, 2004 8:45 pm
Location: Texas

Post 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 ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
attu
Participant
Posts: 225
Joined: Sat Oct 23, 2004 8:45 pm
Location: Texas

Post 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
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

OK conditional trigger in COMMAND EXEC ACTIVITY .
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
attu
Participant
Posts: 225
Joined: Sat Oct 23, 2004 8:45 pm
Location: Texas

Post 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
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post 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?
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>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
attu
Participant
Posts: 225
Joined: Sat Oct 23, 2004 8:45 pm
Location: Texas

Post 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?
sun rays
Charter Member
Charter Member
Posts: 57
Joined: Wed Jun 08, 2005 3:35 pm
Location: Denver, CO

Post by sun rays »

If you are not going to do any iterations then do nothing. The sequence automaticaly stops after the last activity.
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

Post by mystuff »

Craig I dont know why they are using script
What's your database?
attu
Participant
Posts: 225
Joined: Sat Oct 23, 2004 8:45 pm
Location: Texas

Post 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
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

You can put a Sequencer stage in the end with mode set to 'All' and fill in the 'Logging Text'.
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>
Post Reply