GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 154 of 162    Print  
How will work GOBACK statement & STOP RUN & EXIT-PROGRAM in COBOL ?

  
Total Answers and Comments: 3 Last Update: December 29, 2008     Asked by: gilbat82 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: prasanfid
 
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)


Above answer was rated as good by the following members:
i_virus, gilbat82, savemeenachilar, kiranrcse
September 11, 2008 11:46:33   #1  
prasanfid Member Since: September 2008   Contribution: 1    

RE: How will work GOBACK statement & STOP RUN & EXIT-PROGRAM in COBOL ?
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)

 
Is this answer useful? Yes | NoAnswer is useful 3   Answer is not useful 0Overall Rating: +3    
October 21, 2008 04:55:02   #2  
aratik Member Since: October 2008   Contribution: 3    

RE: How will work GOBACK statement & STOP RUN & EXIT-PROGRAM in COBOL ?
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.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
December 29, 2008 07:41:37   #3  
vidhyakk Member Since: December 2008   Contribution: 1    

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

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.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape