STOP

Purpose

When the STOP statement is executed, the program stops executing and, if a character constant or digit string is specified, prints the keyword STOP followed by the constant or digit string to unit 0.

Syntax

Read syntax diagramSkip visual syntax diagram>>-STOP--+---------------+-------------------------------------><
         +-char_constant-+
         '-digit_string--'
 

char_constant
is a scalar character constant that is not a Hollerith constant
digit_string
is a string of one through five digits

Rules

IBM Extension

If neither char_constant nor digit_string are specified, nothing is printed to standard error (unit 0).

End of IBM Extension

A STOP statement cannot terminate the range of a DO or DO WHILE construct.

IBM Extension

If you specify digit_string, XL Fortran sets the system return code to MOD (digit_string,256). The system return code is available in the Korn shell command variable $?.

End of IBM Extension

Examples

STOP 'Abnormal Termination'    ! Output:  STOP Abnormal Termination
END

STOP                           ! No output
END