DSjob command issue

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

Moderators: chulett, rschirm, roy

maniphilip
Participant
Posts: 17
Joined: Thu Jan 15, 2015 5:21 am
Location: India

DSjob command issue

Post 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.
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Post by arvind_ds »

Make sure to source in dsenv file first and then try dsjob command.
Arvind
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
maniphilip
Participant
Posts: 17
Joined: Thu Jan 15, 2015 5:21 am
Location: India

Post by maniphilip »

Thanks arvind.:) but we did that already..still the same error
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you have execute permission to the binary referred to on line 9?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
maniphilip
Participant
Posts: 17
Joined: Thu Jan 15, 2015 5:21 am
Location: India

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try changing it to

Code: Select all

 . ./dsjob -run TEST TEST
Please also verify permissions on the dsjob executable file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
maniphilip
Participant
Posts: 17
Joined: Thu Jan 15, 2015 5:21 am
Location: India

Post 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
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Post by arvind_ds »

Try chmod 755 dsjob
Arvind
maniphilip
Participant
Posts: 17
Joined: Thu Jan 15, 2015 5:21 am
Location: India

Post by maniphilip »

we changed the permission levels...still it's not working
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post 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.)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Nailed it!

:D
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply