Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.2.27.4 PERFORM with UNTIL Phrase



In the UNTIL phrase format, the procedure(s) referred to are performed until the condition specified by the UNTIL phrase is true. Control is then passed to the next executable statement following the PERFORM statement.


    ___ Format 3 _________________________________________________________________ 
   |                                                                              |
   | >>__PERFORM__ _procedure-name-1__| phrase 1 |__| phrase 2 |_________ _____>< |
   |              |                                      (1)             |        |
   |              |_| phrase 2 |__imperative-statement-1_____END-PERFORM_|        |
   |                                                                              |
   | phrase 1:                                                                    |
   | |__ _______________________________ _______________________________________| |
   |    |_ _THROUGH_ __procedure-name-2_|                                         |
   |      |_THRU____|                                                             |
   |                                                                              |
   | phrase 2:                                                                    |
   | |__ ____________________________ __UNTIL__condition-1______________________| |
   |    |_ ______ __TEST__ _BEFORE_ _|                                            |
   |      |_WITH_|        |_AFTER__|                                              |
   |                                                                              |
   | Note:                                                                        |
 X | (1)  Imperative-statement-1 is optional as an IBM extension.                 |
   |                                                                              |
   |______________________________________________________________________________|

Note: If procedure-name-1 is specified, imperative-statement-1 and the END-PERFORM phrase must not be specified.

condition-1
Can be any condition described under "Conditional Expressions" in topic 6.1.6. If the condition is true at the time the PERFORM statement is initiated, the specified procedure(s) are not executed.

Any subscripting associated with the operands specified in condition-1 is evaluated each time the condition is tested.

If the TEST BEFORE phrase is specified or assumed, the condition is tested before any statements are executed (corresponds to DO WHILE).

If the TEST AFTER phrase is specified, the statements to be performed are executed at least once before the condition is tested (corresponds to DO UNTIL).

In either case, if the condition is true, control is transferred to the next executable statement following the end of the PERFORM statement. If neither the TEST BEFORE nor the TEST AFTER phrase is specified, the TEST BEFORE phrase is assumed.

Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.