Command output of ExecCommand

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Good, one down. What did you find when you searched the forum for your new error message? It's been discussed quite a number of times...

"Controller problem: Unhandled failure"
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Will you STOP using the Field() function until we can sort out exactly which field you want?

Where are you calling the SDK routine UtilityWarningToLog from?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

I am caling the UtilityMessageToLog from the RoutineActivity stage. Now, in the RoutineActivity stage, I have:

RoutineName: UtilityMessageToLog
Value Expression: ReadFile.$CommandOutput

I am still getting the same error. I'll keep doing research on this forum on this error. Please let me know if I can provide any more information.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

Ok. I found why I was getting the error. It is due to the fact that I had "Automatically handle activities that fail" checked. I unchecked it and I don't get the error. Thanks Ray, ArndW and Craig for your help.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You're not done yet. What is it that is causing the activity to fail? If it's the Execute Command activity, this is an exit status other than zero; you may need to make a small adjustment in your shell script (exit 0).

You still have not properly gathered the command output either - or, if you have, you have not posted that you have.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

After using absolute path, proper value is returned by the Linux script. After that, if I use Field(ExecCmd.$CommandOutput, @FM,1,1) or ExecCmd.$CommandOutput wihtout Field, it works.

The RoutineActivity call to UtilityMessageToLog returns a 1. When I check "Automatically Handle Activitties That Fail", it interpretes this as an error and the sequence aborts.

If you have an idea so that I can avoid this without unchecking this property, I would really like to hear it.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use a custom trigger on the Routine activity. Allow 1 as the returned value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use a custom trigger on the Routine activity. Allow 1 as the returned value.
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 »

You don't really need a custom trigger. The thing about the 'automatically handle' option is that it only kicks in it "needs to" - when you don't handle errors. The online help spells it out for you, but basically make it think you've got all the bases covered and those kind of 'failures' won't be an issue.

For example, a typical pair of triggers that shut down the 'automatic' option would be an 'Ok (Conditional)' and an 'Otherwise' link. In your case, the 'Otherwise' link is the one that is actually your expected path but both are needed - send them both to a Sequencer set to 'Any' and then from there to your next step. The 'automatically handle' option can now be turned back on and will function for all of the other activities in your Sequence.
-craig

"You can never have too many knives" -- Logan Nine Fingers
deejje
Premium Member
Premium Member
Posts: 3
Joined: Tue Apr 25, 2006 10:52 pm
Location: Mumbai

Post by deejje »

abc123 wrote:Craig, that was the issue. The relative path. My ExecCommand produces the right values. However, the RoutineActivity still errors out. I still get the error:

Controller problem: Unhandled failure (1) encountered calling routine DSX.UTILITYMESSAGETOLOG

In the RoutineActivity stage, I am selecting Routine Name as UtilityMessageToLog and in Value Expression for Arg1, I have:

Field(ReadFile.$CommandOutput, @FM,1)
The output from the ExecCommand is sometimes appended at the end with a newline character. I ran into a similar problem and selected the leftmost byte from the command output _$CommandOutput that was numeric. I could run my job activity with that. You probably need to find out how to just select numeric characters out of the command output and you should be fine.

Thanks
- Deejje
Post Reply