Skip to Content
Custom Search

COBOL PERFORM UNTIL

 

PERFORM UNTIL
 
The following COBOL program depicts the use of 
PERFORM UNTIL
 
 
       IDENTIFICATION DIVISION.
       PROGRAM-ID. PGM015.
       AUTHOR. MAINFRAMEWIZARD.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 WS-SUB   PIC 9 VALUE ZEROS.
       PROCEDURE DIVISION.
       10000-MAIN-PARA.
             PERFORM 20000-FIRST-PARA UNTIL WS-SUB=5
             DISPLAY 'PARA NAME IS  10000-FIRST-PARA'
             STOP RUN.
       20000-FIRST-PARA.
             DISPLAY 'PARA NAME IS  20000-FIRST-PARA'.
             ADD +1 TO WS-SUB.
 
 
 
The ouput of the above program is 
 
PARA NAME IS  20000-FIRST-PARA                                                                                           
PARA NAME IS  20000-FIRST-PARA                                                                                           
PARA NAME IS  20000-FIRST-PARA                                                                                           
PARA NAME IS  20000-FIRST-PARA                                                                                           
PARA NAME IS  20000-FIRST-PARA                                                                                           
PARA NAME IS  10000-FIRST-PARA                                                                                           
 
 
Note: By default the condition is evaluated before the loop is executed.

Comments

Post new comment

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

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 36 guests online.
Dr. Radut | page