Page 1 of 2

DSjob command issue

Posted: Fri Jan 30, 2015 4:51 am
by maniphilip
We are trying to invoke a job using dsjob command inside a script. But we are getting the following error when we run the script.

line 9: .: ./dsjob: cannot execute binary file


Please help us.

Posted: Fri Jan 30, 2015 4:59 am
by arvind_ds
Make sure to source in dsenv file first and then try dsjob command.

Posted: Fri Jan 30, 2015 7:41 am
by chulett
<post moved to correct forum>

Post your script... what's on line 9? Looks like you're using a relative path, make sure your script cd's to the correct place first or switch to a full path.

Posted: Fri Jan 30, 2015 7:43 am
by maniphilip
Thanks arvind.:) but we did that already..still the same error

Posted: Fri Jan 30, 2015 8:15 am
by chulett
Never mind the whole 'relative path' thing, while fine advice that's obviously not the issue here. Your error is an odd one and generally indicates a compatibility issue - say you bring over the command from another version of UNIX or one compiled with the 'wrong' compiler for the current O/S you could see something like that.

Can you run dsjob from the command line outside your script?

Posted: Fri Jan 30, 2015 8:26 am
by PaulVL
are you able to log in to the command line with dsadm and execute this:
(after sourcing dsenv of course)

$DSHOME/bin/dsjob -lprojects


That will at least tell you if it's the engine or something specific to your project (like if you imported jobs with executables from a different OS) as was mentioned.

Posted: Fri Jan 30, 2015 2:27 pm
by ray.wurlod
Do you have execute permission to the binary referred to on line 9?

Posted: Mon Feb 02, 2015 11:24 pm
by maniphilip
Thank you all for the suggestions.

Please find the script that we are using

#!/bin/bash
. /opt/IBM/InformationServer/Server/DSEngine/dsenv
cd /
cd /opt/IBM/InformationServer/Server/DSEngine/bin/
pwd
. dsjob -run TEST TEST

Since our login ID's doesn't belong to dsadm group , we are executing the script from datastage job. In th datastage job log we could see USER=dsadm.

But we are getting the below error in datastage log
Reply=126
Output from command ====>
/opt/IBM/InformationServer/Server/DSEngine/bin
line 7: .: ./dsjob: cannot execute binary file
Thanks,
Mani

Posted: Mon Feb 02, 2015 11:29 pm
by ray.wurlod
Try changing it to

Code: Select all

 . ./dsjob -run TEST TEST
Please also verify permissions on the dsjob executable file.

Posted: Tue Feb 03, 2015 3:25 am
by maniphilip
We tried with the above suggestion ,but still we are facing the same issue.

Please find the permission on dsjob file
-rwxr-xr-- 1 dsadm dstage

Thanks,
Mani

Posted: Tue Feb 03, 2015 4:06 am
by arvind_ds
Try chmod 755 dsjob

Posted: Tue Feb 03, 2015 5:33 am
by maniphilip
we changed the permission levels...still it's not working

Posted: Tue Feb 03, 2015 8:00 am
by chulett
Have you tried running it manually from the command line as requested? If you still get that error, involve support. If it won't even run from the command line (should give you a basic usage error) then it's corrupt or otherwise invalid.

Posted: Tue Feb 03, 2015 8:57 am
by PaulVL
ray.wurlod wrote:Try changing it to

Code: Select all

 . ./dsjob -run TEST TEST
Try "./dsjob -run TEST TEST". You don't want to do a Dot Space Dot Slash.

Code: Select all

#!/bin/bash 
. /opt/IBM/InformationServer/Server/DSEngine/dsenv
#make sure you are in your personal home
cd
#don't play in the engine path
#cd /opt/IBM/InformationServer/Server/DSEngine/bin/ 
pwd
#$DSHOME set in dsenv
$DSHOME/bin/dsjob -run TEST TEST
(As an admin, I don't like people running stuff with $DSHOME/bin as their current working directory.)

Posted: Tue Feb 03, 2015 10:04 am
by chulett
Nailed it!

:D