COBOL PERFORM Varying with UNITIL Logic

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

30 SQL Practice Queries with Solutions — Run Them Live

Practice 30 SQL queries with solutions, from SELECT and JOINs to subqueries and window functions. Run SQL queries live in an interactive SQL Playground.

Supercharge Your Database Skills: Try Our New Interactive SQL Plugin!

Struggling with database queries? Explore our new interactive SQL plugin to write, test, and master SQL directly in your browser. Try the live demo now!

How to Count Spark Stages by Sight and Optimize Shuffles

Want to predict execution stages before running a job? Learn how to count Spark stages by sight with code breakdowns, shuffle rules, and optimization traps.

Databricks Cluster Min & Max: How to Find and Right-Size

Learn how to find and audit Min and Max worker limits in Databricks, track real cluster usage via system tables, and prevent runaway compute costs.

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

Discover more from Srinimf

Subscribe now to keep reading and get access to the full archive.

Continue reading