Page 1 of 1

help with execute command stage

Posted: Thu May 12, 2011 12:00 pm
by pattemk
Hi,

I have a job that write a value(string 'A' or 'B' or 'C') into a sequential file S1.

I want to execute job1 if value in the file S1 is 'A', job2 if value is 'B' and job3 if value is 'C'

below is my job design

job to generate S1 --> EXECUTE COMMAND ---> JOB1
|-------------------------------------> JOB2
|
|-------------------------------------> JOB 3

i cat the value of S1 and used the following in triggers to the execute command stage ExeCmnd_SysType.$CommandOutput = 'A' and same way for 'B' and 'C'

The sequencer does not execute any of the jobs and finishes successfully with out any warning.

i even checked the the out put of cat command and it returns 'A'.

PLEASE ADVICE what should i do to make it work.

thanks

Posted: Thu May 12, 2011 12:56 pm
by vinothkumar
Check any new line/extra characters are coming in your output.

Posted: Thu May 12, 2011 1:28 pm
by pattemk
the format in the file is none for everything, final delimiter - none, delimiter - none, quote - none.

i checked in the value of file too, it was only A

Posted: Thu May 12, 2011 2:03 pm
by Mike
vonothkumar is right on target.

The content of the file and how the file was created isn't important.

How the execute command activity formats $CommandOutput is important.

It has been discussed many times on DSXchange. A search of $CommandOutput and the field mark (@FM) character should turn up exactly what you need.

Mike

Posted: Thu May 12, 2011 5:30 pm
by chulett
Yup, command output is a dynamic array so you need to remove the included (invisible) Field Mark or specify only the first element of the array. And as noted, discussed here many times with full syntax examples. :wink:

Posted: Thu May 12, 2011 10:17 pm
by greggknight
Why not write a routine that reads the file and puts the value into an argument of the routine. You can then use the routine stage in the sequence to get the value and direct the flow.

I do it and it works fine.

Posted: Fri May 13, 2011 10:53 am
by pattemk
i never used routine stage, would like to know, i will go through posts and documentation and give it a try.

thanks for all the help.