What is the difference between Stop Run and Go Back

3 posts / 0 new
Last post
Anonymous
What is the difference between Stop Run and Go Back

 

 

I am new to COBOL, and I heard that we have two commands for terminating a COBOL program, i.e. "STOP RUN" or "GO BACK"

Can some one be kind enough to explain the difference?

 

"; ; ; ;
Offline
Joined: 07/07/2011 - 19:59
Stop run vs Goback
A Stop run stops the unit of work and returns control to the operating system. A Goback returns control to the calling program. This may appear trivial but it is very important. If program A calls program B and program B issues a stop run, then execution of the unit of wok ceases, and program A never gets control back. While if program B issues a GOBACK, control is returned to the statement after the call to program B in program A. In the good old days you could lose your job if you coded a "STOP RUN" in a CICS program as the STOP RUN caused the CICS TASK to STOP running and brought the CICS REGION down. Modern versions of CICS are smarter that that and will not be brought down by a "STOP RUN" in a COBOL Program, but i would still not try it if i where you?
Anonymous
STOP RUN terminates the run

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.

Thanks,

ASG

Log in or register to post comments
Sponsored Listing