RE: What will happen if we give GOBACK instead of STOP...
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....
RE: What will happen if we give GOBACK instead of STOPRUN in a cobol program which is not called by some other program?
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 GOBACK EXIT PROGRAM
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.