Execute Command Stage return value

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
arpitchopra
Participant
Posts: 35
Joined: Mon Nov 01, 2010 2:48 am
Location: New Delhi

Execute Command Stage return value

Post by arpitchopra »

Hi everyone,

I am facing a very strange problem. Here is my sequence design:


Execute command -----return val 0---------> job1
-----return val 1---------> job2


The command stage executes a unix script which returns 0 if a file is found and 1 if it is not found (using "exit 0" or "exit 1"). The trigger in Command stage reads this returned value and moves to Job1 if it is 0 and Job2 if it is 1.

My requirement in both the cases is is that this master sequence should always finish successfully. However, right now, it finishes with a warning. Whenever the script returns 1, the sequence throws a "Warning" that "Command did not finish OK, reply = 1".

Is there any way to suppress this ?
Arpit Chopra
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes. Create explicit triggers for Warning and Failure. These take precedence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arpitchopra
Participant
Posts: 35
Joined: Mon Nov 01, 2010 2:48 am
Location: New Delhi

Post by arpitchopra »

How ??
Arpit Chopra
kishore2456
Participant
Posts: 47
Joined: Mon May 07, 2007 10:35 pm

Post by kishore2456 »

In Triggers tab of execute command stage you can specify your both conditions(success and failure) using different links where you can validate your conditions using the return value
FD
arpitchopra
Participant
Posts: 35
Joined: Mon Nov 01, 2010 2:48 am
Location: New Delhi

Post by arpitchopra »

I'm doing exactly that.
But, in the triggers tab, I use Return Value option. if = 1 then Job1 and if = 0 then Job2.

But still, when the command executes, it gives a warning.
Arpit Chopra
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

In the trigger tab.

Expression type : Custom
Expression : <Execcmdstagename.ReturnValue>=1

Is this what you have given
arpitchopra
Participant
Posts: 35
Joined: Mon Nov 01, 2010 2:48 am
Location: New Delhi

Post by arpitchopra »

Nopes.

Expression Type: Return Value (Conditional)
Expression: = 1



But I have a solution to the problem. Found it on the forum itself. Suppressed that warning by unchecking the "Log warnings after activities that finish with status other than OK"


Thanks for the help guys.
Arpit Chopra
Post Reply