Error on executing Shell script in After job subroutine

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
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Error on executing Shell script in After job subroutine

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

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

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

"You can never have too many knives" -- Logan Nine Fingers
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

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

Post by chulett »

Consider your nit picked. :lol:
-craig

"You can never have too many knives" -- Logan Nine Fingers
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Post 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:
abhishekachrekar
Participant
Posts: 45
Joined: Wed May 02, 2007 8:30 am
Location: Prague, Czech Republic

Post 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
Regards,
Abhishek
Post Reply