Can “STOP RUN” be given in COBOL subroutines

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.

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.

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.