Hi
I am trying to use ExecSH in before job subroutine where i am calling a shell script which performs deletion of a million rows in a table x . When i was trying to execute the shell from datastage using ExecSH i am getting following error....... but shellscript works fine when i run from cmd line...
what might be the reasons for the error
jobtest1..BeforeJob (ExecSH): Error when executing command: "/Project/Source/xxx.ksh"
*** Output from command was: ***
DB="db2"
+ DB=db2
USERID="cooo"
+ USERID=cooo
PASSWD="xxx"
+ PASSWD=xxx
db2 "connect to $DB user $USERID using $PASSWD"
+ db2 connect to dedw1d user edwd using twins
SQL10007N Message "-5005" could not be retrieved. Reason code: "2".
if [ $? -ne 0 ]; then
echo "Unable to Connect to database $DB"
exit 1
fi
+ [ 8 -ne 0 ]
+ echo Unable to Connect to database dedw1d
Unable to Connect to database dedw1d
+ exit 1
Job stopped - before-job routine returned error: Error 1 returned from BEFORE routine DSU.ExecSH
ExecSH
Moderators: chulett, rschirm, roy
Hi & welcome aboard,
Some times the parameters passed from DS to scripts or what ever get messed up, especially when you need the whole string to contain qoutes.
this can be resoled in manipulation on the actual string you run (search this forum it was discused).
another way might be to use a user defined query using the gui stages, where you can also use parameters.
IHTH,
Some times the parameters passed from DS to scripts or what ever get messed up, especially when you need the whole string to contain qoutes.
this can be resoled in manipulation on the actual string you run (search this forum it was discused).
another way might be to use a user defined query using the gui stages, where you can also use parameters.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
DS runs under the engines environment, not the user running the job. Testing a script from the command line is comparing apples to toaster ovens. You must look at the environment your jobs execute under and make sure all variables and paths are appropriate.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle