Command sh did not finish OK, reply =

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

Moderators: chulett, rschirm, roy

Post Reply
shankar_ramanath
Premium Member
Premium Member
Posts: 67
Joined: Thu Aug 09, 2007 7:51 pm

Command sh did not finish OK, reply =

Post by shankar_ramanath »

In one of the job sequences I use the "Execute Command" activity which is used to invoke a shell script.

The shell script returns two values depending upon the logic: 0 or 1.

In the job sequence I use triggers to branch the flow depending upon the return value.

When the shell script returns "1", the Director log reports a warning message.

I would like to get rid of the warning message. Since this is a job sequence, I am unable to demote/suppress the warning message.

Could you please let me know how to get rid of the warning message?

I realize that such warning messages are helpful. In this case, however, the return value is only used for branching the flow and hence the warning messages are superfluous.

Thanks,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create explicit triggers (custom triggers) to handle the explicit exit status values plus - if needed - an Otherwise trigger to handle unexpected values.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted, handle it yourself and the automatically logged 'unhandled exception' message will go away.
-craig

"You can never have too many knives" -- Logan Nine Fingers
shankar_ramanath
Premium Member
Premium Member
Posts: 67
Joined: Thu Aug 09, 2007 7:51 pm

Post by shankar_ramanath »

Thanks Gentlmen.

I did as suggested and the warning message still persists. I am not sure what I am missing.

The shell script that I use returns a value $returnVal. $returnVal can be one of two values: 0 or 1.

In the Execute Command activity, I have two two branches: one with ReturnValue (Conditional) = 0 and the other with ReturnValue (Conditional) = 1.

When I compiled the initial post, the values were ReturnValue (Conditional) = 0 and Otherwise, which I have corrected now.

I still get the warning message, "Command sh did not finish OK, reply = '1'"

I do not get this warning for "ReturnValue = 0".

Please let me know how to get rid of the warning message.

Thanks again,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Uncheck the "automatically generate warnings" option in Job Properties.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or just use the proper trigger conditions as posted earlier - Finished OK for the 0 link and Otherwise for the 1 link. It will then know that you are handling any errors and stop doing it itself.
-craig

"You can never have too many knives" -- Logan Nine Fingers
shankar_ramanath
Premium Member
Premium Member
Posts: 67
Joined: Thu Aug 09, 2007 7:51 pm

Post by shankar_ramanath »

chulett wrote:Or just use the proper trigger conditions as posted earlier - Finished OK for the 0 link and Otherwise for the 1 link. It will then know that you are handling any errors and stop doing it itself.
I tried what Craig had suggested by changing the Expression Type to "OK (Conditional)" - I could not find "Finished OK" but I think this is what was meant. The warning message "Command sh did not finish OK, reply = '1'" still persisted.

I tried what Ray suggested (Unchecked the box "Log warnings after activities finish with status other than OK) and the issue does not exist. I am a bit concerned about this approach because it happens at the job level (and not at the stage level), but I can live with it for now.

Many thanks to both of you,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You need both links in order for this to work correctly and yes, you picked the right "OK" one. Run both into a Sequencer set to Any and then on to the next activity if either one is valid for the next step.
-craig

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