cobol1.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
PERFORM (↑ Statements)
 Key                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Verb:         PERFORM
 
  Function:     Causes a group of statements to be executed repeatedly.
                If the statements are a procedure, this statement
                repeatedly transfers control to that procedure, with
                automatic return of control each time the procedure
                finishes.
 
  Syntax:       Which format?  Simple  TIMES
                               UNTIL    VARYING
 
  ──PERFORM─┬─procedure-name-1─┬─────────────────────────────┬─phrase─┬─
              │                  └┬─THROUGH─┬─procedure-name-2─┘        │
              │                   └─THRU────┘                           │
              └─phrase──imperative-statement END-PERFORM────────────────┘
 
  where phrase is:
 
  ─┬──────────────────────┬─VARYING─┬─identifier-2─┬──────────────────────
    └┬────┬─TEST─┬─BEFORE─┬┘         └─index-name-1─┘
     └WITH┘      └─AFTER──┘
 
  ────────FROM─┬─identifier-3─┬─BY─┬─identifier-4─┬─UNTIL─┬─condition-1─┬─
                ├─index-name-2─┤    └─literal-2────┘       └─EXIT────────┘
                └─literal-1────┘
 
  ┬──────────────────────────────────────────────────────────────────────┬
   │ ┌───────────────────────────────────────────────────────────────────┐│
   │ ▼                                                                   ││
   └─AFTER─┬─identifier-5─┬─FROM─┬─identifier-6─┬─BY─┬─identifier-7─┬─┐  ││
           └─index-name-3─┘      ├─index-name-4─┤    └─literal-4────┘ │  ││
                                 └─literal-3────┘                     │  ││
                                                      ┌───────────────┘  ││
                                                      └─UNTIL condition-2─┘
                                    -♦-