Page 1 of 1

dsjob exits with unknown status code

Posted: Fri Oct 05, 2007 1:24 pm
by pimmit22043
Hi,

I have a sequencer that runs for 3 hrs and finishes successfully.
We use the command line to kick off the job

dsjob -run -jobstatus ${ParamList} ${ds_proj}

when it starts it prints

...Waiting for job

but when the sequencer is successful it returns the stutus code the job { $?} as 141 but I'm looking for a return code of 1 or 2 .

Did anybody come across the status code and what does it mean?

Posted: Fri Oct 05, 2007 1:37 pm
by chulett
Yes, it has been seen before and discussed here. However, never did get an answer as to what it means and why it went away (for me) as quickly as it appeared...

viewtopic.php?t=106570&highlight=status+141

Posted: Sun Jan 20, 2008 9:48 am
by Vinodanand
Can you please check the timeout setting in the administrator. This issue normally pops up when the time out is set for say 1 hour and the job runs for more than the the timeout set .

Thanks,
Vinod

Posted: Sun Jan 20, 2008 11:01 am
by kumar_s
Does this happes for all the job in the Project or only for that particular job??

Posted: Sun Jan 20, 2008 11:23 am
by ds_is_fun
The return value of a simple command is its exit status, or
128+n if the command is terminated by signal n. So your script was terminated by signal 13, which is SIGPIPE
(you look in /usr/include/sys/signal.h to find that out). If you are just looking for "unix exit status" then use $? which would either be 0(success) or 1 (failure)

If you are specifically looking to return the DS return status then you will need to do something like below-
cd $DSHOME/bin
JOB_STATUS_MSG1=`dsjob -jobinfo $PROJECT $DSJOB_CHKRUN | head -1 | cut -d"(" -f2 | cut -d")" -f1`
export JOB_STATUS_MSG1
echo "JOB_STATUS_MSG1= " $JOB_STATUS_MSG1

The return codes for DS are -
################################################################################
# Runnable Job Status (do something)
# 1 "Finished"
# 2 "Finished (see log)"
# 9 "Has been reset"
# 11 "Validated OK"
# 12 "Validated (see log)"
# 21 "Has been reset"
# 99 "Compiled"
################################################################################
1|2|7|9|11|12|21|99)
:
;;
################################################################################
# NOT Runnable Job Status (reset job)
# 0 "Running"
# 3 "Aborted"
# 8 "Failed validation"
# 13 "Failed validation"
# 96 "Aborted"
# 97 "Stopped"
# 98 "Not Compiled"
################################################################################

Posted: Sun Jan 20, 2008 11:29 am
by chulett
Vinodanand wrote:Can you please check the timeout setting in the administrator. This issue normally pops up when the time out is set for say 1 hour and the job runs for more than the the timeout set .
Don't think this has anything to do with timeouts - at least not in my experience. In my exposure to it, it was happening in two different installations where the timeout was disabled.

Posted: Sun Jan 20, 2008 11:41 am
by chulett
ds_is_fun wrote:The return value of a simple command is its exit status, or 128+n if the command is terminated by signal n. So your script was terminated by signal 13, which is SIGPIPE.
Not sure there's anything simple about this, both times I presented it to IBM Support they couldn't tell me where it was coming from. It happened for a little while, then went away - never to be seen again.

We use a wrapper script using dsjob to launch our jobs from ^M with the -jobstatus option, it passes that back out as the exit status of the script itself. The jobs always completed successfully when we saw this, so the 'normal' exit status that would have been passed back should have been a 1. So you are saying that my jobs completed normally, passed back an exit status of '1' and then in that last moment the script itself got a SIGPIPE error? Don't really think so, not even sure what 'pipe' would be involved in something as simple as this. :?