Guardian Procedure Calls Reference Manual

C Completion Codes
This appendix lists the completion codes returned after execution of a process or, in some instances,
a job step. These codes indicate the degree of success of a program in a standard manner, thus
making it possible to create or build further steps based on these codes.
Completion codes -32768 through -1 are reserved for HP use. The caller must be privileged to
have a negative completion code returned to its ancestor. Completion codes 0 through 999 are
reserved and are shared by the customer and HP.
Completion codes from 1000 through +32767 are reserved for customers. HP subsystems will not
use these completion codes.
These completion codes are defined and must be used according to these definitions for uniformity:
DefinitionCompletion Code
Normal, voluntary termination with no errors. This code is the default code for PROCESS_STOP_
(if abnormal termination is not specified) and STOP if no completion code is specified, and for the
OSS exit() function if the exit status is 0.
0
Normal, voluntary termination with WARNING diagnostics. For example, if the process is a
compiler, the compilation terminated with WARNING diagnostics after building a complete object
file.
1
Abnormal, voluntary termination with FATAL errors or diagnostics. For example, if the process is
a compiler, the compilation terminated with FATAL diagnostics and either an object file was not
built or, if built, might be incomplete. A complete listing is generated.
2
Abnormal, voluntary, but premature termination with FATAL errors or diagnostics. For example, if
the process is a compiler, the compilation terminated with FATAL diagnostics, with either no object
3
file or an incomplete object file being built and an incomplete listing generated (the compiler quit
compiling prematurely).
Process never got started. This completion code exists primarily for the use of the command
interpreter or other command language interpreters that can act as the executor process of a batch
4
job. This code allows the executor process to detect that a process associated with a RUN statement
never got started. In that sense, this completion code is a "fake" completion code. The command
interpreter acts as though it received a termination message from the process that it tried to create,
when in fact it received an error returned by the procedure or OSS function that launched the
process. The command interpreter then makes the completion code and the error returned by the
procedure or OSS function that launched the process available for evaluation, for example, by a
batch job executor process.
Process calls PROCESS_STOP_ (with abnormal termination specified) or ABEND on itself. This code
is the default completion code for the PROCESS_STOP_ procedure (when abnormal termination is
specified) and the ABEND procedure.
5
PROCESS_STOP_, STOP, or ABEND was called to delete a process by an external, but authorized,
process. The system includes this completion code in the process deletion message. If the process
6
cannot be stopped, the request is saved so that when the process calls SETSTOP this completion
code is sent with the process deletion message. The user ID, the PCBCRAID (CAID) and the process
ID of the process that caused the termination, are included in the termination message.
Restart this job. This completion code is used by the NetBatch scheduler and an executor process.
The executor process sets its completion code to this value upon termination; the scheduler interprets
this completion code and restarts a "restartable" job.
7
Code 8 is the same as code 1, normal termination, except that the user must examine the listing
file to determine whether the results are acceptable. Completion code 8 is typically used by
compilers.
8
The kill() or raise() function generated a signal that stopped the process. The termination
information provides the signal number.
9
NOTE: If a signal is delivered to a signal handler that stops the process, the completion code
will be determined by the handler. For example, when a signal stops a native C program, a
different completion code is returned as set by the signal handler installed by the Common Run-Time
Environment (CRE).
1533