FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-105
STOP Statement
STOP Statement
The STOP statement terminates program execution.
message
is an unsigned integer constant up to five digits long or a character constant up to
80 characters long that FORTRAN displays when your program executes a STOP
statement.
If you compile your program with ENV OLD in effect, FORTRAN displays message
on your home terminal unless you specify the TERM run-option when you run your
program, in which case FORTRAN displays message on the device you specify in
the TERM run-option.
If you compile your program with ENV COMMON, FORTRAN writes message to
the standard log file. For more information about the standard log file, see the CRE
Programmer’s Guide.
Considerations
The STOP statement terminates execution of the entire executable program.
Executing a STOP statement in a subroutine terminates execution of that
subroutine, the calling main program, and all other subroutines called by the main
program.
FORTRAN automatically closes files that are open when the STOP statement
executes.
If you compile your FORTRAN program with the ENV OLD directive in effect, you
can call the FORTRANCOMPLETION utility routine instead of executing a STOP
statement. FORTRANCOMPLETION performs the same tasks as STOP, but you
can also specify completion codes and related information for the STOP and
ABEND procedures. For more information, see the FORTRANCOMPLETION
Routine on page 15-2.
If you compile your FORTRAN program with the ENV COMMON directive in effect,
you can call the FORTRAN_COMPLETION_ utility routine instead of executing a
STOP statement. FORTRAN_COMPLETION_ performs the same tasks as STOP,
but you can also specify completion codes and related information for the
PROCESS_STOP_ procedure. For more information, see the
FORTRANCOMPLETION Routine on page 15-2.
Example
STOP 'End of job.'
STOP 55489
STOP [ message ]