Problem with triggers in the Execute Command Activity stage

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
JPalatianos
Premium Member
Premium Member
Posts: 306
Joined: Wed Jun 21, 2006 11:41 am

Problem with triggers in the Execute Command Activity stage

Post by JPalatianos »

Hi,
We have a need to send different emails (subject, body and attachments) based on a file condition.

We have a simple sequence job with a Execute Command Activity with two links both going to Notification Stages.

The command is: "wc -l"
with the following as the parameter:
"D:\CRM\work_files\Paris_ctr.txt" | awk '{ printf "%s", $1 }'

The Dslink10 trigger is:
Expression Type: ReturnValue - (Conditional)
Expression: >0

The Dslink14 trigger is:
Expression Type: Otherwise
Expression: N/A

No matter what is returned from the command we always go to the Otherwise DsLink14

When I check the director Log I see the appropriate output:
TestingSequnceConditions_1..JobControl (@Execute_Command_12): Executed: wc -l "D:\CRM\work_files\Paris_ctr.txt" | awk '{ printf "%s", $1 }'
Reply=0
Output from command ====>
1
Since 1 is > 0, We were thinking we should go to the conditional Dslink10 but we always go to the otherwise link regardless of the output.

Any thoughts why we are seeing this behavior.

Thanks - - John
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Problem with triggers in the Execute Command Activity st

Post by SURA »

Hi

You given just > 0
or
Activity variable, stagename.$CommandOutput > 0
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Return value is the exit status.

You probably need to test the value of $CommandOutput activity variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
JPalatianos
Premium Member
Premium Member
Posts: 306
Joined: Wed Jun 21, 2006 11:41 am

Post by JPalatianos »

Hi Sura,
AFter changing the expression to:
Execute_Command_12.$CommandOutput > 0

The job works as expected.

Thank You Very Much for your assistance!!!!
Post Reply