Passing output from shell script to a job
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
Passing output from shell script to a job
Hi Guys,
After executing a shell script using Execute Command stage in job sequencer, How do I capture the output value returned by the shell script and pass it on to a server job, without writing it to a sequential file and again reading it? Is there a direct way to do it?.
Thanks,
Naveen
After executing a shell script using Execute Command stage in job sequencer, How do I capture the output value returned by the shell script and pass it on to a server job, without writing it to a sequential file and again reading it? Is there a direct way to do it?.
Thanks,
Naveen
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In the Job Activity, click on Insert Parameter Value. This opens the External Parameter Helper dialog, on which you will see the Execute Command Activity.
Expand this and you will see three things that you can use to supply a value to the currently selected job parameter.
Expand this and you will see three things that you can use to supply a value to the currently selected job parameter.
- $CommandName the name of the command (shell script)
$ReturnValue the exit status of the command
$CommandOutput anything on the command's stdout
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: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
Hi Ray,
I tried to implement the solution pointed out by you and I am getting an error.
I have defined a job parameter called TestOutput and have populated it with the output value of $CommandOutput (actual value is "Execute_Command_0.$CommandOutput")
The following is the log of the job run
Thanks,
Naveen
I tried to implement the solution pointed out by you and I am getting an error.
I have defined a job parameter called TestOutput and have populated it with the output value of $CommandOutput (actual value is "Execute_Command_0.$CommandOutput")
The following is the log of the job run
I am not using any LimitValue, therefore the problem is with the parameter value that I am passing. Could you please tell me what I am doing wrong ?TESTEXESCRIPT..JobControl (@Execute_Command_0): Executed: /FTP/CPS/FTPPLAYGROUND/DEV/test.sh
Reply=0
Output from command ====>
/FTP/CPS/FTPPLAYGROUND/DEV/serial_test.txt
TESTEXESCRIPT..JobControl (@Job_Activity_1): Controller problem: Error calling DSSetParam(TestOuput), code=-4
[ParamValue/Limitvalue is not appropriate]
Thanks,
Naveen
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What type is the job parameter? String? Integer? Date? The error code -4 says that the value you've provided is not apporpriate for the parameter type. What value was provided? Check for line terminator characters in $CommandOutput - you may need to trim them.
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: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Your job sequence must have, as a very minimum:
I believe yours does not.
When it does, and the Execute Command activity's properties have properly been filled in, you can do what was described above.
Code: Select all
ExecuteCommand -----> JobActivity
When it does, and the Execute Command activity's properties have properly been filled in, you can do what was described above.
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.