COBOL Questions and Answers

What is the difference between PERFORM … WITH TEST AFTER and PERFORM … WITH TEST BEFORE?

If TEST BEFORE is specified, the condition is tested at the beginning of each repeated execution of the specified PERFORM range.

If TEST AFTER is specified, the condition is tested at the end of the each repeated execution of the PERFORM range. The range is executed at least once in TEST AFTER.