The STOP literal statement is classed as an obsolete element in the ANSI'85 Standard and is scheduled to be deleted from the next full revision of the ANSI Standard.
All dialects within this COBOL implementation fully support this syntax. The FLAGSTD Compiler directive can be used to detect all occurrences of this syntax.
Although it is a part of the standard COBOL definition, the Stop literal format is explicitly excluded from the X/Open COBOL language definitions and should not be used in an X/Open COBOL conforming source program.
A signed integer is allowed.
This rule is not enforced, although any statements in the sentence that follow the STOP RUN statement will not be executed.
If the GIVING phrase is not specified then the run unit operates as if the system area were declared as a COBOL numeric data item with USAGE COMP-5 and with a size determined by the operating environment external to the COBOL system and as if a MOVE statement had been executed with the RETURN-CODE as the sending item and the system area as the receiving item. (See the topic Special Registers in the chapter Concepts of the COBOL Language for details of RETURN-CODE.)
If the GIVING identifier-1 phrase is specified, identifier-1 must describe the same number of character positions as is required to hold the return value in the system area and must be of the type and usage that is expected by the operating system. Typically, identifier-1 needs to be declared explicitly or implicitly as PIC S9 (9) USAGE COMP-5; this declaration depends on the value of the RTNCODE-SIZE Compiler directive. The run unit operates as if a MOVE statement had been executed with identifier-1 as the sending item and the system area as the receiving item.
If the GIVING integer-1 phrase is specified, integer-1 must not be larger than the value that can be held in the system area. The run unit operates as if a MOVE statement had been executed with integer-1 as the sending item and the system area as the receiving item.
CALL 'CBL_THREAD_EXIT' USING BY VALUE ADDRESS OF thread-parm