help with execute command 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
pattemk
Participant
Posts: 84
Joined: Wed May 16, 2007 4:04 pm

help with execute command stage

Post 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
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Check any new line/extra characters are coming in your output.
pattemk
Participant
Posts: 84
Joined: Wed May 16, 2007 4:04 pm

Post 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
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
greggknight
Premium Member
Premium Member
Posts: 120
Joined: Thu Oct 28, 2004 4:24 pm

Post 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.
"Don't let the bull between you and the fence"

Thanks
Gregg J Knight

"Never Never Never Quit"
Winston Churchill
pattemk
Participant
Posts: 84
Joined: Wed May 16, 2007 4:04 pm

Post 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.
Post Reply