STOP RUN terminates the run unit,and deletes all dynamically called
programs in the run unit and all programs link-edited with them. (It
does not delete the main program.)STOP RUN statement does not have to be the last statement in a sequence, but the statements following the STOP RUN will not be executed.STOP RUN statement closes all files defined in any of the programs
GOBACK statement specifies the logical end of a called program or invoked method.Should appear as the only statement or as the last of a
series of imperative statements in a sentence because any statements following theGOBACK are not executed.
IN COBOL PROGRAMMING IF YOU PUT STOP RUN AFTER ANY SENTENCE THEN THE CONTROL COMES OUT OF PROGRAM AND IN CASE OF GO TO CONTROL WILL PASS TO THE STATEMENT SPECIFIED IN THE GO TO STATEMENT
STOP RUN can only be used in the main program. When executed, it returns back to OS.
GOBACK can be used both in the main program and in a sub program.
GOBACK returns controls either back to the main program or to the OS.
Any statement following the GOBACK execution results in the subsequent statements not being executed.
Statements following STOP RUN are also not executed.
GOBACK in the sub program functions as an exit program.