ExecSH

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Mark j
Participant
Posts: 20
Joined: Tue Apr 20, 2004 9:26 am

ExecSH

Post by Mark j »

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
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by 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,
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
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

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
Mark j
Participant
Posts: 20
Joined: Tue Apr 20, 2004 9:26 am

Post by Mark j »

Thanks guys for your replies... yeah i did check the path ... but as roy was saying i tried using the path as a string and it is working....



Thanks again
Mark
Post Reply