Here’s logic how to use PERFORM UNTIL. We use PERFORM statement for handling loops in COBOL. Here, this example shows PERFORM with UNTIL.
PERFORM Varying Until Syntax
FROM start-value BY increment-value
PERFORM Varying UNTIL Example
FROM 1 BY 1
UNTIL TEST-1 > 1000
OR FILE-SWITCH = 'EOF'
You can use this COBOL logic written using PERFORM TEST AFTER. This is one best way of handling loops in COBOL programs. After reading input files you need to validate each record. So this logic helps you as a guide.