7.8.3 Checking the return code of a job
You can check the return code of a job in the Monitor Details - [unit-name] dialog box of JP1/AJS3 - View, or from the value of EXITCODE in the job information output by the jpqjobget command. Under normal circumstances, 0 is set as the return code when a job terminates normally. If the job terminates abnormally, the return code of the job process is set. However, in the following cases, the return code is set by JP1/AJS3.
- #
-
If a problem occurs during post-processing by JP1/AJS3 after a job process has terminated (for example, if the result file could not be transferred to the manager host), the return code of the job process is overwritten with -1 by JP1/AJS3 and the job process terminates abnormally.
- Cautionary note
-
For a PC job, the started job process itself can return the return code -1. For a Unix job, if a job returns a negative value, the return code is assumed to be the returned value plus 256. For example, if a job process ends with -1, the return code is 256 - 1 = 255. In a user application, if you need to determine whether the return code was set by the job process or JP1/AJS3, do not use a return code of -1 or 255 in your user applications.
For details about the return codes set while an event job or action job is being executed (from the start to end of the job process), see A. Return Values from Event Jobs and Action Jobs.
In some cases the return code of a job is set by the OS, rather than by a user application or JP1/AJS3. The following table gives examples of typical return codes. Because upgrading your OS might change these return codes, check the technical information for your OS.
OS |
Return code |
Cause |
Action to take |
---|---|---|---|
Windows |
259 or -1 |
The process might have failed to open the results file. In this case, one of the following occurs:
|
As the standard output file or standard error output file when you register a job, do not specify a file opened from within a program executed as a job or opened by redirection from a batch file. However, where the file is opened from within the program by a function call, you can work around the problem by opening the file with a setting that permits shared read and write modes. |
128 |
There might be a desktop heap shortage. If so, one of the following messages is output:
|
To reduce use of the desktop heap, use the same user account as the JP1/AJS3 service to execute jobs. |
|
UNIX |
Signal number + 128 |
A program started from a job process might have received a signal.# |
Take one of the following actions:
|
- #
-
If the job process itself receives a signal, jobs with Standard specified as the execution service will change to the Killed status with the return code -1. Jobs with Queueless Agent specified as the execution service will change to Ended abnormally status with the return code -1.