The VARYING phrase increases or decreases the value of one or more identifiers or index-names, according to certain rules. (See "Varying Phrase Rules" in topic 6.2.27.10.)
The Format 4 VARYING phrase PERFORM statement can serially search an entire 7-dimensional table.
___ Format 4 _____________________________________________________________________________________ | | | >>__PERFORM____________________________________________________________________________________> | | | | >__ _procedure-name-1__ _______________________________ __| phrase 1 |__ ______________ _ ____>< | | | |_ _THROUGH_ __procedure-name-2_| |_| phrase 2 |_| | | | | |_THRU____| | | | | (1) | | | |_| phrase 1 |__imperative-statement-1_____END-PERFORM________________________________| | | | | phrase 1: | | |__ ____________________________ __VARYING__ _identifier-2_ __FROM__ _identifier-3_ __BY_______> | | |_ ______ __TEST__ _BEFORE_ _| |_index-name-1_| |_index-name-2_| | | |_WITH_| |_AFTER__| |_literal-1____| | | | | >__ _identifier-4_ __UNTIL__condition-1________________________________________________________| | | |_literal-2____| | | | | phrase 2: | | <_______________________________________________________________ | | |____AFTER__ _identifier-5_ __FROM__ _identifier-6_ __| phrase 3 |_|___________________________| | | |_index-name-3_| |_index-name-4_| | | |_literal-3____| | | | | phrase 3: | | |__BY__ _identifier-7_ __UNTIL__condition-2____________________________________________________| | | |_literal-4____| | | | | Note: | X | (1) Imperative-statement-1 is optional as an IBM extension. | | | |__________________________________________________________________________________________________|Note: If procedure-name-1 is specified, imperative-statement and the END-PERFORM phrase must not be specified. If procedure-name-1 is omitted, the AFTER phrase must not be specified.
After the condition(s) specified in the UNTIL phrase are satisfied, control is passed to the next executable statement following the PERFORM statement.
If any of the operands specified in condition-1 or condition-2 is subscripted, reference modified, or is a function-identifier, the subscript, reference-modifier, or function is evaluated each time the condition is tested.
When TEST BEFORE is indicated, all specified conditions are tested before the first execution, and the statements to be performed are executed, if at all, only when all specified tests fail. When TEST AFTER is indicated, the statements to be performed are executed at least once, before any condition is tested.
If neither the TEST BEFORE nor the TEST AFTER phrase is specified, the TEST BEFORE phrase is assumed.
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.