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.15 EXIT METHOD Statement




X The EXIT METHOD statement specifies the end of an invoked method.


 X  ___ Format _____________________________________________________________ 
 X |                                                                        |
 X | >>__EXIT METHOD.____________________________________________________>< |
   |                                                                        |
   |________________________________________________________________________|

X You can specify EXIT METHOD only in the Procedure Division of a method.
X EXIT METHOD causes the executing method to terminate, and control returns
X to the invoking statement. If the containing method specifies the
X Procedure Division RETURNING phrase, the value in the data item referred
X to by the RETURNING phrase becomes the result of the method invocation.


X If you need method-specific data to be in the last-used state on each
X invocation, declare it in method Working-Storage. If you need
X method-specific data to be in the initial state on each invocation,
X declare it in method Local-Storage.


X If control reaches an EXIT METHOD statement in a method definition,
X control returns to the point in the invoking program or method immediately
X following the INVOKE statement. The state of the invoking program or
X method is identical to that which existed at the time it executed the
X INVOKE statement.


X The contents of data items and the contents of data files shared between
X the invoking program or method and the invoked method could have changed.
X The state of the invoked method is not altered except that the end of the
X ranges of all PERFORM statement executed by the method are considered to
X have been reached.


X The EXIT METHOD statement does not have to be the last statement in a
X sequence of imperative statements, but the statements following the EXIT
X METHOD will not be executed.


X When there is no next executable statement in an invoked method, an
X implicit EXIT METHOD statement is executed.

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.