Extracting info from the consol

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Extracting info from the consol

Post by videsh77 »

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?
Thanks with regards,
videsh.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Status is reported through stderr (it is documented thus).

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.
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

Thanks Ray, it worked as expected.
Thanks with regards,
videsh.
Post Reply