Return code from ExecuteCommand Stage in Job Sequencer

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
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Return code from ExecuteCommand Stage in Job Sequencer

Post 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
Saludos,

Miguel Seclén
Lima - Peru
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Use 'ReturnValue' for a Routine Activity stage, for the Execute Command stage use a Custom trigger and check $CommandOutput instead.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Post by jseclen »

Thanks the job sequencer is working ok.
Saludos,

Miguel Seclén
Lima - Peru
Post Reply