Trigger In Execute Command Stage Fails

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

Post Reply
mikesherm
Participant
Posts: 18
Joined: Thu Sep 17, 2009 12:25 pm

Trigger In Execute Command Stage Fails

Post by mikesherm »

I'm using an Execute Command stage in a Sequencer job to grab a single value from a text file (the file has only one value). In this case, the value in the text file is 1.

I've created a DOS batch file to read the value from the file:

@Echo Off
set /p "var="<"C:\IBM\Data\Dev\Output\ChecksumTest.txt"
echo %Var%

I've set Command in the stage to run the .bat file.

The trigger in the Command Stage is set as follows: Execute_Command_17.$CommandOutput > 1

When I look at the Event Detail, the value seems to be returned:

DBC_Master_Daily_Sequence..JobControl (@Execute_Command_17): Executed: C:\IBM\Data\Dev\Output\ReturnValue.bat
Reply=255
Output from command ====>
1
However, the trigger doesn't work as one would expect as the next stage in the Sequence still runs.

Any help would be appreciated. Thanks.
Mike Sherman
Senior Consultant
Creative Computing, Inc.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Command Output is a dynamic array rather than a single value, with returns being converted to Field Marks. Remove them then check:

Code: Select all

Convert(@FM,"",Stage.$CommandOutput) > 1
Or reference just the first array element:

Code: Select all

Stage.$CommandOutput<1> > 1
-craig

"You can never have too many knives" -- Logan Nine Fingers
mikesherm
Participant
Posts: 18
Joined: Thu Sep 17, 2009 12:25 pm

Post by mikesherm »

Chulett,

If I read your post correctly I changed the Trigger to:

CONVERT(@FM, "",Execute_Command_17.$CommandOutput > 1)

However, this still didn't work. Am I missing anything?

Mike
Mike Sherman
Senior Consultant
Creative Computing, Inc.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The right parenthesis is misplaced. Try

Code: Select all

CONVERT(@FM, "",Execute_Command_17.$CommandOutput) > 1
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 »

Hmmm... I thought for a moment you meant mine was. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
mikesherm
Participant
Posts: 18
Joined: Thu Sep 17, 2009 12:25 pm

Post by mikesherm »

Thanks, Guys. Problem Solved. :lol:
Mike Sherman
Senior Consultant
Creative Computing, Inc.
Post Reply