How will work GOBACK statement & STOP RUN & EXIT-PROGRAM in COBOL ?

Questions by gilbat82   answers by gilbat82

Showing Answers 1 - 5 of 5 Answers

prasanfid

  • Sep 11th, 2008
 

goback
- When specified in main program, will act like stop run. i.e give control back too
O.S
- When specified in sub-program, will give control back to main program

Exit-program
- When specified in main program, will throw abend4038 (compilation) error, since it wont give the control back to the
O.S
- When specified in sub-program, will give control back to main program

stop run

- Will stop the current program and give control back to O.S (even in sub-program)

GOBACK gives the controll to main program if we have called the subprogram from the main program.

STOP RUN: This statement  halts the execution of the object program,and returns control to the system.

EXIT-PROGRAM: This statement specifies the end of a called program and returns control to the calling program.

vidhyakk

  • Dec 29th, 2008
 

Go-Back can be used in both main program and sub program. In the sub program it acts as Exit program and in main program it acts as stop run.
Stop Run can only be used in main program but cannot be used in sub program.
Exit- Program can be used in Sub program only.

  Was this answer useful?  Yes

STOP RUN: IT terminates the current program.

GO Back: When we apply in place of stop run the loop will be continued infinately.

Exit: It's a optional one, for paragraphs we can apply this one.

Eg: Para
      --------
      --------
     Exit-para.


     

satya valluru

  • May 29th, 2012
 

STOP RUN: We can use only in Main PGM.will return control BACK to O.S
GO BACK: We can use in both Main & Sub PGMs.will return control BACK to Main PGM or O.S.
EXIT-PROGRAM:Only for Sub PGM.will return control BACK to Main PGM.

  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.

 

Related Answered Questions

 

Related Open Questions