sign in
 
   
 
 
 
   
  COBOL TUTORIAL FOR BCA STUDENTS OF M G UNIVERSITY  
  UNIT 4: PROCEDURE DIVISION . . .  
   
  Sequence Control Verbs  
     
 

GO TO Verb

 
 

GO TO verb is used to unconditionally transfer the control to elsewhere in the program.
Its form is as follows:

 
   
 

The procedure name can be a section name or a paragraph name.As a result of the execution of this statement, the control is transferred to the first statement of the paragraph or section mentioned in the procedure name.

Example:


 
 

GO TO ERROR-ROUTINE.

 
 

Suppose ERROR-ROUTINE is a paragraph name. The execution of this statement will transfer the control to the first statement in ERROR-ROUTINE. On the other hand, suppose ERROR-ROUTINE is a section name and FIRST-PARA is the name of the first paragraph in this section. In this case control will be transferred to the first statement in FIRST-PARA. It may be noted that GO TO FIRST-PARA is identical to GO TO ERROR-ROUTINE.

 
   
   
  STOP RUN  
 

This verb causes the termination of the execution of the object program.

Its form is: