Re: Stop Run vs GoBack




"Roger While" <simrw@xxxxxxxxxxxx> wrote in message
news:f5q485$ngp$03$1@xxxxxxxxxxxxxxxxxxxx
[snip]
Of course, ABSENCE of L/S does not imply anything about a
program either.
In fact, I have 2 ported apps that each contain a prog (without L/S) that
is
both run as a free-standing (main) program and as a callable
module.
Original machine environment for these app's is unknown
except it was "big iron".
Interestingly enough, both of these progs have a single exit
point which is an EXIT PROGRAM as the last statement in
the source. (That, at least, is the state in which I received them;
I can not say if they have been modified from the real original)

Beginning with COBOL 85, if control passes through
the last statement in a program, the runtime behavior
is an implicit EXIT PROGRAM statement followed
by an implicit STOP RUN statement. With 2002, an
implicit GOBACK statement is executed.

FDIS ISO/IEC 1989:2002, page 388, 14.5.3 Explicit
and implicit transfers of control,
"There is also no next executable statement after the last
statement in a source element when the paragraph in
which it appears is not being executed under the control
of some other COBOL statement in that source element,
after the end marker, and if there are no procedure
division statements in a program, function, or method. In
these cases, an implicit GOBACK statement without any
optional phrases is executed."



.