Suppress "Status Code=0" output of dsjob command
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 45
- Joined: Thu Aug 31, 2006 3:13 am
- Location: Bangalore
Suppress "Status Code=0" output of dsjob command
hi,
I have configured shell script which calls "dsjob" command to execute an Datastage job in the "Extrnal Source Stage". But, dsjob command after execution outputs below information.
-------------------------------------------------------------------------
Finished waiting for job
Status code = 0
Status code = 0
-------------------------------------------------------------------------
Now, the above output from External Source stage gets into other succeeding stages in the job as input. Which I don't want. Can anybody tell me whether can we suppress the above output thatz coming from "dsjob" command.
I tried multiple ways to avoid this such as
(1) I have used "/dev/null"
(2) tried to redirect the output to temporary file "/tmp/tempfile.txt"
But even after I tried doing above mechanisms am still unable to suppress the output thrown by "dsjob command".
Can anybody please suggeste me here onto how can I suppress this output message.
Thanks & regards
Sudhindra P S
I have configured shell script which calls "dsjob" command to execute an Datastage job in the "Extrnal Source Stage". But, dsjob command after execution outputs below information.
-------------------------------------------------------------------------
Finished waiting for job
Status code = 0
Status code = 0
-------------------------------------------------------------------------
Now, the above output from External Source stage gets into other succeeding stages in the job as input. Which I don't want. Can anybody tell me whether can we suppress the above output thatz coming from "dsjob" command.
I tried multiple ways to avoid this such as
(1) I have used "/dev/null"
(2) tried to redirect the output to temporary file "/tmp/tempfile.txt"
But even after I tried doing above mechanisms am still unable to suppress the output thrown by "dsjob command".
Can anybody please suggeste me here onto how can I suppress this output message.
Thanks & regards
Sudhindra P S
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
That throws too much away! Try
Code: Select all
dsjob ... | grep -v 'Status code = 0'
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.
Hi,
I am sorry to reopen this old issue.
Actually, i was trying to suppress this return code (Status code = 0) from my dsjob commands. I got this issue posted few months back and i tried this option posted by ray.wurlod. But, couldn't succeed in eliminating this return code.
Can anyone let me know how this can be achieved.
I am sorry to reopen this old issue.
Actually, i was trying to suppress this return code (Status code = 0) from my dsjob commands. I got this issue posted few months back and i tried this option posted by ray.wurlod. But, couldn't succeed in eliminating this return code.
Code: Select all
dsjob ... | grep -v 'Status code = 0'
Thanks and Regards!!
dspxlearn
dspxlearn
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You want to suppress the status code and now you want the status code?
If the dsjob command has the -jobstatus option, then the exit status of dsjob is the exit status of the executed job.
If the dsjob command has the -jobstatus option, then the exit status of dsjob is the exit status of the executed job.
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 don't want to capture the status codes and it doesn't have -jobstatus option in it.
my code was
I tried to redirect it to device null (>/dev/null) but it isn't working..
my code was
Code: Select all
dsjob -stageinfo DS_PROJECT DS_JOB$INVOCATION_ID DS_STAGE
Thanks and Regards!!
dspxlearn
dspxlearn
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Ok, now here is my code:
Code: Select all
$DSTAGE_EXE/dsjob -lstages $DS_PROJECT $DS_JOB$INVOCATION_ID | grep 'Src_' > $File
SrcCnt=0
TotalCnt=0
for LINE in `cat ${File}`
do
SrcCnt=`$DSTAGE_EXE/dsjob -stageinfo $DS_PROJECT $DS_JOB$INVOCATION_ID $LINE | grep -v 'Status code = 0' | grep "In Row Number" | cut -f2 -d ":" | awk '{print $1}'` > /dev/null
TotalCnt=`expr $TotalCnt+ $StageCnt`
done
echo "Total count of source records: $TotalCnt"
Thanks and Regards!!
dspxlearn
dspxlearn
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: