Page 1 of 1

Error on executing Shell script in After job subroutine

Posted: Mon Jan 03, 2005 1:04 am
by rajeev_prabhuat
Hi,

I have a job which calls a shell script "del_indicator.sh " in the after job subroutine, the job is getting executed with Warning error and the error is as follows:
ODH_INDICATOR_FILE_JOB..AfterJob (ExecSH): Error when executing command: /opt/dsadm/del_indicator.sh /opt/ascential/DataStage/Projects/ODH/indicator_report/indicator_file.txt
*** Output from command was: ***
SH: 9148 Bus error(coredump)
Can anyone tell me why this problem.

The shell script checks the data in the text file (which is send as parameter) and if the data in the text file is "0" then removes the file from the specified folder and if it is > 0 then does not do anyting. When i execute the same in the unix promt it is working fine but when i call it through DS it is giving me the above error.


Regards,
Rajeev Prabhu

Posted: Mon Jan 03, 2005 7:59 am
by kcbland
Obviously the error is in the shell script. The problem you are encountering is that DataStage jobs run as your userid, but using the environment of the server engine. You need to verify the contents of the environment are what you shell script requires. As easy way is to put 'env' in to the shell script to dump to screen the environment.

After you confirm that this is your problem, you need to search this forum and learn more about DataStage, as this is a FAQ. You will find out how to fix the problem by making sure the dsenv file is properly configured, again searching this forum will help you.

Posted: Mon Jan 03, 2005 8:37 am
by chulett
kcbland wrote:Obviously the error is in the shell script.
Possibly, but not necessarily. :wink:

If you are running on HP/UX, then simply using the Korn shell in DataStage can cause a core dump on some versions. I've seen this in the past where they ran fine in Dev or Test but started core dumping on the Production server after a certain point in time. :evil:

Two solutions, from what I recall:

1) Use the standard (?) shell - 'sh' rather than 'ksh'. Unless you've used some specific Korn syntax it will work without any changes.

2) Comment out the LD_PRELOAD environment variable from your dsenv file - unless you are also running PX.

I believe Tony or Vince had the same issue as I did and got the same solutions. There should be posts on this subject as well here. Again, this would all be predicated on the OP running on HP/UX.

Edit: Here is the saga of my little problem. :wink:

Posted: Mon Jan 03, 2005 9:03 am
by kcbland
chulett wrote:
kcbland wrote:Obviously the error is in the shell script.
Possibly, but not necessarily. :wink:
Okay, pick that nit. But, the solution is going to be in the script, as well as all troubleshooting. So, my statement in spirit, is correct. :wink:

Posted: Mon Jan 03, 2005 9:17 am
by chulett
Consider your nit picked. :lol:

Posted: Mon Jan 03, 2005 9:14 pm
by rajeev_prabhuat
Hi,

Thanks to all your reply, as Chullet and other told it was error in the Shell Script, we were using KSH command which was not required, i removed that and it worked fine, Thank you.

Regards,
Rajeev Prabhu
chulett wrote:Consider your nit picked. :lol:

Posted: Fri Jun 27, 2008 2:17 am
by abhishekachrekar
Thanks Guys,

I too faced similar issue. The script was called using an KSH command.
I removed it and now its working fine.

Thanks a lot :)

Regards,
Abhishek