Skip to Content
Custom Search

COBOL GO TO DEPENDING ON

 

GO TO DEPENDING ON
 
The following COBOL program depicts the use of 
GO TO DEPENDING ON
 
       IDENTIFICATION DIVISION.
       PROGRAM-ID. PGM014.
       AUTHOR. MAINFRAMEWIZARD.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 PARA-NUM PIC 9 VALUE ZEROS.
       PROCEDURE DIVISION.
       10000-MAIN-PARA.
             MOVE 2 TO PARA-NUM
             GO TO  20000-FIRST-PARA
                    25000-SECOND-PARA
                    30000-THIRD-PARA
             DEPENDING ON PARA-NUM
             DISPLAY 'PARA NAME IS  10000-FIRST-PARA'
             STOP RUN.
       20000-FIRST-PARA.
             DISPLAY 'PARA NAME IS  20000-FIRST-PARA'.
       25000-SECOND-PARA.
             DISPLAY 'PARA NAME IS  25000-SECOND-PARA'.
       30000-THIRD-PARA.
             DISPLAY 'PARA NAME IS  30000-THIRD-PARA'
 
 
 
The output of the program is 
 
 
PARA NAME IS  25000-SECOND-PARA                                                                                          
PARA NAME IS  30000-THIRD-PARA                                                                                           

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Who's online

There are currently 0 users and 33 guests online.
Dr. Radut | page