Hi
If I run the command below in Unix
./bin/dsjob -lparams <projname> <dsjobname> > Somefile.txt
Parameters gets copied to the Somefile.txt but status of the command shown separately on the consol.
For unsuccessful command I get following output :
Status code = 0
ERROR: Failed to open job
For successful command as well we get
Status code = 0
So I would like to capture ERROR in my script so as to find out which job could not provide params
it has.
If the output of the command above if I assign it to the variable in a script, these details are
not retained in that variable. Can someone guide me how to capture this ERROR so I can mention some
xyz job is unable to provide parameters?
Extracting info from the consol
Moderators: chulett, rschirm, roy
Extracting info from the consol
Thanks with regards,
videsh.
videsh.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Status is reported through stderr (it is documented thus).
Redirect file unit 2 to an appropriate file (or even to the same file).
Redirect file unit 2 to an appropriate file (or even to the same file).
Code: Select all
$DSHOME/bin/dsjob -lparams $project $jobname > Somefile.txt 2>Error.txt
$DSHOME/bin/dsjob -lparams $project $jobname > Somefile.txt 2>&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.