The statement “STOP RUN” be given usually in calling modules. When the “STOP RUN” statement encounters, this tells COBOL run-time unit to stop execution of COBOL program.
Why Can’t STOP RUN to be Given in Subroutine
- This is the reason, it cannot be given in subroutines. The point is, the same question asked in many interviews that, what happens if be given in subroutines.
- The answer is, COBOL run time unit gets stopped unexpectedly and the calling module issues an abend/exception.
- But, the non standard GOBACK statement can be given in both calling/called modules.