Autosys JOB is not waiting for the Shell Script to complete

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
dgokulakrishnan
Participant
Posts: 14
Joined: Wed May 01, 2013 1:06 pm

Autosys JOB is not waiting for the Shell Script to complete

Post by dgokulakrishnan »

Dear Team -

We are using Datastage to load Netezza Tables. After the load completes using a UNIX Shell script to copy certain tables data from One database to another Database.

And we plan to schedule a autosys JOB to invoke the Shell script but whenever we test the Autosys JOB it completes less than 60 seconds and it affects the Shell Script execution as well.

When I execute the Shell Script alone it works perfectly.

Can you please help to resolve this issue.
Thanks & Regards,

Gokula Krishnan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

A little lost. :?

Is this actually a DataStage question or are you simply having a problem using Autosys to run a shell script? For the latter I'm going to give you some standard advice for shell scripts, especially for ones that 'work perfectly' when run manually but fail in some fashion when run under automation.

Make no assumptions in the script. Set / source any environment variables you need. Don't assume you know what the Current Working Directory is if you are using relative paths, 'cd' where you need to be for paths to work properly. Etc etc.

If you need more help, please be more specific with regards to the nature of the issues you are facing. For example, saying "it affects the Shell Script execution" doesn't really help us help you. Affects it how? In what way?
-craig

"You can never have too many knives" -- Logan Nine Fingers
dgokulakrishnan
Participant
Posts: 14
Joined: Wed May 01, 2013 1:06 pm

Post by dgokulakrishnan »

This question is w.r.to Autosys & Shell Script.

Script has to copy around 50 tables from one DB to other DB.

Autosys JOB completes less than 60 seconds hence the script also aborts before it copy all the 50 tables to other DB.

sometimes it copies 5 to 10 tables only.
Thanks & Regards,

Gokula Krishnan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use a DataStage sequence to control which tables get copied.

Start only the sequence from the third party scheduler (Autosys).

Much cleaner.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... not a DataStage issue or question. Probably better to ask this on an Autosys support forum. Regardless, my previous reply still stands - there's obviously something incorrect in your script if it only works correctly when run manually.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Are you using -wait option?
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't believe there is a DataStage component to this and thus no use of dsjob... best I can tell, anywho.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I understand you Craig but now I am lost as to what the question is.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You are not alone, my friend.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bikramkumar.sahu@yahoo.co
Participant
Posts: 1
Joined: Wed Dec 03, 2014 8:40 am

Re: Autosys JOB is not waiting for the Shell Script to compl

Post by bikramkumar.sahu@yahoo.co »

If your main script (script triggered by the Autosys job) is triggering multiple subscripts independently then you might face this issue where Autosys job will not wait for the script to complete. Try to use datastage or if you are not using Datastage then use one single script.
Bikram
Post Reply