Getting ExecuteCommand CommandOutput value in a sequencer
Moderators: chulett, rschirm, roy
Getting ExecuteCommand CommandOutput value in a sequencer
I have a sequencer loop where I have an ExecCommand followed by a JobActivity stage. In the ExecCommand, I am calling an UNIX command, cat filename, which has a value. I would like to do ExecCommand.CommandOutput to get this value, add 1 to it and use that value as one of the paramters of the job in the following JobAcitivity's job. This doesn't work. Any ideas would be appreciated.
Why it doesn't work? Are you getting any error or it doesnt give the expected value? Explain how are you passing the value.
You can use the ReturnValue of the ExecuteCommand Acitivity to pass the value of the output. And you can manipulate the same in the Job.
You can use the ReturnValue of the ExecuteCommand Acitivity to pass the value of the output. And you can manipulate the same in the Job.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You are missing a dollar sign.
In version 7.1 and later you can select this from the "Add Job Parameter" dialog.
Code: Select all
ExecCommand.$CommandOutput
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I would try:
Code: Select all
ExecCommand.$CommandOutput<1> + 1
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The command output includes line terminators. These are translated by DataStage into field marks (@FM) so that what you get is a dynamic array containing one field per line of output. The angle brackets notation with embedded "1" returns field #1. You could also have specified
Code: Select all
Field(ExecCommand.$CommandOutput, @FM, 1, 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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You would also find it in the Server Job Developer's Guide because a job sequence is just a special case of a server job (and that's the main reason that server jobs aren't going away any time soon).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.