sign in
 
   
 
 
 
   
  COBOL TUTORIAL FOR BCA STUDENTS OF M G UNIVERSITY  
  UNIT 4: PROCEDURE DIVISION . . .  
   
  GO TO WITH DEPENDING ON PHRASE  
   
 
The GO TO statement with a DEPENDING phrase has the following form:

 
   
 

The statement transfers control to one of the procedures named in the statement depending on the value of the identifier. Depending on whether the value of the identifier is 1, 2, . . . , n, the control is transfered to procedure-name-1, procedure-name-2, . . . , procedure-name-n respectively. If the value of the identifier is anything other than 1,2, . . . , n the said GO TO statement is ineffective and the control is transferred to the next statement in sequence. The identifier specified in the statement must be a numeric, integral elementary item.

Example:


 
 

GO TO ADD-PARA, SUB-PARA, MUL-PARA, DIV-PARA

DEPENDING ON USER-CHOICE.

 
 

The names ADD-PARA, SUB-PARA, MUL-PARA and DIV-PARA are either paragraph names or section names.