Page 1 of 1

Return code from ExecuteCommand Stage in Job Sequencer

Posted: Wed Sep 03, 2008 3:02 pm
by jseclen
Hi Forum

I create a job that evaluate a flat file, when existing wrong records will reject a file.

This job is called from a job sequencer using JobActivity stage, after this stage i use an ExecuteCommand stage, in this stage i execute the follow command:

wc -l /dat/CLIENTES2.REJ | awk '{print $1}'

this file contains the wrong record of input file, if don't exists records the sequencer will continue con the next JobActivity stage, else will execute another command and finish.

in the Triggers tab in the Execute Command define the Expression Type for the links:

Name Expression Type Expression
link_ok ReturnValue - (Conditional) = 0
link_err ReturnValue - (Conditional) > 0

when run the job the exe command returns the follow message:

seqValidar..JobControl (@Validar_Rechazos): Executed: wc -l /dat/CLIENTES2.REJ | awk '{print $1}'
Reply=0
Output from command ====>
5

my question is, which is the value will take the trigger to evaluate, the 0 from the 'Reply=0' or the 5 from 'Output from the command ==> 5', because in the test always run the link_ok (and the wc return 5 rows)

I will expect for your comments

Posted: Wed Sep 03, 2008 3:33 pm
by chulett
Use 'ReturnValue' for a Routine Activity stage, for the Execute Command stage use a Custom trigger and check $CommandOutput instead.

Posted: Thu Sep 04, 2008 8:45 am
by jseclen
Thanks the job sequencer is working ok.