Suppress status code of dsjob command

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Suppress status code of dsjob command

Post by kaps »

Hi

Can anyone tell me how can I suppress the return staus code value which we get after running the dsjob command ?

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Redirect stdout and stderr to /dev/null
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Instead of directly executing dsjob use a shell script that runs the dsjob command that parses the dsjob exit code and returns whatever exit codes you want.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

dont include the -jobstatus option along with the -run. This way you will only get either a 1 or a 0. Then you can use either Ray or Ken's suggestion to obtain your goal.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

Thanks for the replies.

I am using shell script and I am not running the command.
I can't redirect my stdout to /dev/null as I need the output of the command. I need to execute the following command.

dsjob -report DS_PROJECT DS_JOB XML

If I redirect my stdout as following then everything will be ruoted to /dev/null which I don't want...

dsjob -report DS_PROJECT DS_JOB XML > /dev/null

I need the output in STDOUT but I also want to supress the return status code.

Please throw some idea...

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What the heck do you mean by 'suppress the return status code'? You can return whatever you want from the script but can't 'suppress' it - it needs to return something. If you don't want to send back anything from dsjob - don't. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

Craig

what I meant from suppressing staus code is....If I execute the command
[b]dsjob -report Prokect_Name Job_Name XML[/b] from a shell script it gives me the job statistics and also gives me [b]Status code = 0[/b] as the last line. I don't want this status code.

Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Thats the status code of the dsjob command itself. It will not show up in the xml file, if thats wht you are worried about.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Pipe the result through grep -v Status code =
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply