What will happen if we give GOBACK instead of STOPRUN in a cobol program which is not called by some other program?

This question is related to TCS Interview

Showing Answers 1 - 7 of 7 Answers


  • Dec 23rd, 2006

the pgm will go to an infinite loop

  Was this answer useful?  Yes

The program wont go into aninfinite loop!!!
The results are same while using GOBACK or STOP RUN.
Except in the first case if there is a calling program control will pass back.
 The programmer can use any of these 2 commands to end pocessing....


  • Jan 31st, 2009

If GOBACK is coded instead of STOPRUN in a cobol program which is not called by any other program, nothing wrong will happen. The program will give desired results.

Generally 3 things are coded to halt the execution of a program, they are


STOP RUN is frequently used and mainly coded in main programs(calling program). The control will be returned to OS.

GOBACK is coded in the mainly in the subroutines or called programs. The control will be returned to the calling program. If STOP RUN is coded in the calling program, the program will go to an infinite execution. GOBACK can be coded in the programs which is not called by any programs instead of STOP RUN.

EXIT PROGRAM is seldom used.

  Was this answer useful?  Yes


  • Jul 3rd, 2009

In case of subprogram, GOBACK or STOPRUN used to terminate the sub program, but when it is used in main progarm it will cause the program to terminate.

  Was this answer useful?  Yes


  • Jan 26th, 2010

Stoprun gives back control to OS . Goback will give back control from where the control was achieved.

If goback is coded in sub program the control will be passed to main program, if Goback is coded in main program itself then control will be passed to OS.

So if goback is coded in a cobol program instead of Stoprun there will be no problem,But if stop run is coded in sub program the program wiil abend.


  • Aug 27th, 2010

When the goback is specified in the mainprogram, the control will go back to the runjcl from which step the control came. It will start executing the next step in the JCL if available, the program will continue normally.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account

Send   Reset


Related Answered Questions


Related Open Questions