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

PERFORM paragraph-name
VARYING a-variable-value
FROM start-value BY increment-value
UNTIL some-condition-is-met

PERFORM Varying UNTIL Example

PERFORM PARA-A
VARYING TEST-1
FROM 1 BY 1
UNTIL TEST-1 > 1000
OR FILE-SWITCH = 'EOF'

Bonus Post

COBOL: How to use PERFORM-TEST-AFTER Logic

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.

Related Posts

LATEST POSTS

Azure Data Factory (ADF): The Complete Beginner-Friendly Guide (2026 Edition)

Azure Data Factory (ADF) is Microsoft’s fully managed, cloud-based data integration and orchestration service. It helps you collect data from different sources, transform it at scale, and load it into your preferred analytics or storage systems. Whether you are working with Azure SQL, on-premises databases, SaaS applications, or big-data systems, ADF gives you a unified…

Something went wrong. Please refresh the page and/or try again.