Natural for Mainframes Version 8.2.5 for Mainframes
 —  Statements  —

STOP

STOP      

This document covers the following topics:


Function

The STOP statement is used to terminate the execution of a program and return to the command input prompt.

One or more STOP statements may be inserted anywhere within a Natural program.

The STOP statement will terminate the execution of the program immediately. Independent of the positioning of a STOP statement in a subroutine, any end-page condition specified in the main program will be invoked for final end-page processing during execution of the STOP statement.

For Natural RPC: See Notes on Natural Statements on the Server in the Natural RPC (Remote Procedure Call) documentation.

Top of page

Example

** Example 'STPEX1': STOP                                               
************************************************************************
DEFINE DATA LOCAL                                                       
1 #CODE (A1)                                                            
END-DEFINE                                                              
*                                                                       
INPUT //                                                                
  10X 'PLEASE SELECT COMMAND' //                                        
  10X 'LIST VIEW      (V)' /                                            
  10X 'LIST PROGRAM * (P)' /                                            
  10X 'TECH INFO      (T)' /                                            
  10X 'STOP           (.)' //                                           
  20X 'CODE:' #CODE                                                     
*                                                                       
*                                                                       
DECIDE ON FIRST #CODE                                                   
  VALUE 'V'                                                             
    STACK TOP DATA    'VIEW'                                            
    STACK TOP COMMAND 'LIST'                                            
  VALUE 'P'                           
    STACK TOP COMMAND 'LIST PROGRAM *'
  VALUE 'T'                           
    STACK TOP COMMAND 'LAST *'        
    STACK TOP COMMAND 'TECH'          
    STACK TOP COMMAND 'SYSPROD'       
  VALUE '.'                           
    STOP                         
  NONE                                
    REINPUT 'PLEASE ENTER VALID CODE' 
END-DECIDE                            
*                                     
*                                     
END

Output of Program STPEX1:

PLEASE SELECT COMMAND
                     
LIST VIEW      (V)   
LIST PROGRAM * (P)   
TECH INFO      (T)   
STOP           (.)   
                     
          CODE:

Top of page