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

6.2.36 STOP Statement



The STOP statement halts execution of the object program either permanently or temporarily.


    ___ Format _____________________________________________________________ 
   |                                                                        |
   | >>__STOP__ _RUN_______ _____________________________________________>< |
   |           |_literal-1_|                                                |
   |                                                                        |
   |________________________________________________________________________|
literal
May be numeric or nonnumeric, and may be any figurative constant except ALL literal. If the literal is numeric, it must be an unsigned integer.


X May be a signed numeric integer or non-integer literal, but may not be
X a floating-point literal.

When STOP literal is specified, the literal is communicated to the operator, and object program execution is suspended. Program execution is resumed only after operator intervention, and continues at the next executable statement in sequence.

The STOP literal statement is useful for special situations (a special tape or disk must be mounted, a specific daily code must be entered, and so forth) when operator intervention is needed during program execution. However, the ACCEPT and DISPLAY statements are preferred when operator intervention is needed.


X >_Workstation_> Under AIX, OS/2, and Windows, do not use the STOP RUN or
X STOP literal statement in programs compiled with the THREAD compiler
X option. <_Workstation_<

When STOP RUN is specified, execution of the object program is terminated, and control is returned to the system. If a STOP RUN statement appears in a sequence of imperative statements within a sentence, it must be the last or only statement in the sequence.


X The STOP RUN statement does not have to be the last statement in a
X sequence, but the statements following the STOP RUN will not be executed.

The STOP RUN statement closes all files defined in any of the programs comprising the run unit.

For use of the STOP RUN statement in calling and called programs, see the table below.


 Termination 
 Statement   
 Main Program                 
                              
 Subprogram                   
                              
 STOP RUN    
             
             
             
             
 Return to calling program.   
 (May be the system and cause 
 the application to end.)     
                              
                              
 Return directly to the       
 program that called the main 
 program.  (May be the system 
 and cause the application to 
 end.)                        


>_Host_> When running on OS/390 and using the linkage stack instructions, STOP RUN cannot be used to terminate a COBOL run unit from a subprogram if the linkage stack level has changed from the time the COBOL main program for that run unit was entered. <_Host_<

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.