Hi All,
I have a Unix script which calls a data stage job.
While executing the script from Datastage 7.5 server it runs fine. But the same script while executing from V8 server it's giving error " bash: dsjob: command not found " . Any help would be appreciated.
Below is the script
----------------------
dshome=`cat /.dshome`;export dshome
PATH=$PATH:$dshome/lib; export PATH
. $dshome/dsenv
PROJECT=P_Dev
JOB=test_job
RunInfo=`dsjob -run -jobstatus $PROJECT $JOB 2>&1`
echo $RunInfo
Thanks,
sjordery
Run Datastage Job from Unix Shell Script
Moderators: chulett, rschirm, roy
This is bog standard command line stuff and I'm sure an exact search here for "command not found" will turn up all of the lectures on the subject. It's a pity that people nowadays are so entrenched in a GUI mouse-driven world that simple stuff like this trips them up. Makes old farts like me sad.
UNIX is a little pickier about how it finds commands than DOS is. You always need to tell it where your command lives. You do this using three different mechanisms:
1) You include the directory where it lives in your $PATH environment variable, then it can find it 'automatically'.
2) Use a relative path to tell it where it lives. This means the path is relative to where you are and starts with a dot which stands for your "current directory".
3) Use a full path to tell it where it lives. This means it doesn't matter where you are, just it, and the path starts with a forward slash i.e. "from root".
An example of #2 from the bin directory: RunInfo=`./dsjob xxxx
An example of #2 from $DSHome: RunInfo=`./bin/dsjob xxxx
An example of #3: RunInfo=`/etl/DataStage/DSEngine/bin/dsjob xxxx
NOTE: completely made up full path shown as an example only, if you want to see what yours is do the same thing your script is doing:
![Sad :(](./images/smilies/icon_sad.gif)
UNIX is a little pickier about how it finds commands than DOS is. You always need to tell it where your command lives. You do this using three different mechanisms:
1) You include the directory where it lives in your $PATH environment variable, then it can find it 'automatically'.
2) Use a relative path to tell it where it lives. This means the path is relative to where you are and starts with a dot which stands for your "current directory".
3) Use a full path to tell it where it lives. This means it doesn't matter where you are, just it, and the path starts with a forward slash i.e. "from root".
An example of #2 from the bin directory: RunInfo=`./dsjob xxxx
An example of #2 from $DSHome: RunInfo=`./bin/dsjob xxxx
An example of #3: RunInfo=`/etl/DataStage/DSEngine/bin/dsjob xxxx
NOTE: completely made up full path shown as an example only, if you want to see what yours is do the same thing your script is doing:
Code: Select all
cat /.dshome
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thanks Chullet, Below one worked.
------------------------------------------------
dshome=`cat /.dshome`;export dshome
PATH=$PATH:$dshome/lib; export PATH
. $dshome/dsenv
PROJECT=P_Dev
JOB=test_job
RunInfo=`/opt/IBM/InformationServer/Server/DSEngine/bin/dsjob -run -jobstatus $PROJECT $JOB 2>&1`
echo $RunInfo
--------------------------------------------------
Regards,
Sjordery.
------------------------------------------------
dshome=`cat /.dshome`;export dshome
PATH=$PATH:$dshome/lib; export PATH
. $dshome/dsenv
PROJECT=P_Dev
JOB=test_job
RunInfo=`/opt/IBM/InformationServer/Server/DSEngine/bin/dsjob -run -jobstatus $PROJECT $JOB 2>&1`
echo $RunInfo
--------------------------------------------------
Regards,
Sjordery.
can you add to your path env variable ?
The library path env variable ( Depending on your Unix 'flavor' ) SHLIB_PATH or LD_LIBRARY_PATH should include your
It seems your lib folder is in the path , which is not recommended
From the datastage install guide
Code: Select all
$DSHOME/bin
The library path env variable ( Depending on your Unix 'flavor' ) SHLIB_PATH or LD_LIBRARY_PATH should include your
Code: Select all
$DSHOME/lib
From the datastage install guide
Code: Select all
Platform Environment Variable
Solaris LD_LIBRARY_PATH
HP-UX SHLIB_PATH
HP_UX Itanium LD_LIBRARY_PATH
AIX LIBPATH
Compaq Tru64 LD_LIBRARY_PATH
LINUX LD_LIBRARY_PATH