Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

X 6.2.17 GOBACK Statement




X The GOBACK statement functions like the EXIT PROGRAM statement when it is
X coded as part of a called program (or the EXIT METHOD statement when it is
X coded as part of an invoked method) and like the STOP RUN statement when
X coded in a main program.


X The GOBACK statement specifies the logical end of a called program or
X invoked method.


 X  ___ Format _____________________________________________________________ 
 X |                                                                        |
 X | >>__GOBACK__________________________________________________________>< |
   |                                                                        |
   |________________________________________________________________________|

X A GOBACK statement should appear as the only statement or as the last of a
X series of imperative statements in a sentence because any statements
X following the GOBACK are not executed. It must not be used in a
X declarative procedure in which the GLOBAL phrase is specified.


X If control reaches a GOBACK statement while a CALL statement is active,
X control returns to the point in the calling program immediately following
X the CALL statement, as in the EXIT PROGRAM statement.


X If control reaches a GOBACK statement while an INVOKE statement is active,
X control returns to the point in the invoking program or method immediately
X following the INVOKE statement, as in the EXIT METHOD statement.


X In addition, the execution of a GOBACK statement in a called program that
X possesses the INITIAL attribute is equivalent to executing a CANCEL
X statement referencing that program.


X The table below shows the action taken for the GOBACK statement in both a
X main program and a subprogram.


RevisionX  Termination 
RevisionX  Statement   
RevisionX                               
RevisionX  Main Program                 
RevisionX                               
RevisionX  Subprogram                   
RevisionX  GOBACK      
RevisionX              
RevisionX              
RevisionX              
RevisionX  Return to calling program.   
RevisionX  (Can be the system and thus  
RevisionX  causes the application to    
RevisionX  end.)                        
RevisionX  Return to calling program.   
RevisionX                               
RevisionX                               
RevisionX                               




Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.