BREAK-LEVEL is both a report-processing concept and a reserved system field in modern Easytrieve. When you list fields on a CONTROL statement, the report writer watches those fields for value changes between consecutive detail records. Each change triggers control break processing—subtotals, optional NEWPAGE, and your BEFORE-BREAK or AFTER-BREAK procedures. On a single boundary more than one control field may change at once, especially when input is sorted major-to-minor. The system field BREAK-LEVEL tells you which outermost break level fired so your procedure can print the right banner or skip redundant work. Broadcom 11.6 also reserves BREAK-LEVEL as a keyword, which breaks legacy programs that innocently used BREAK-LEVEL as a user field name years ago. This page covers definition, purpose, version history, variable usage rules, comparison with LEVEL and HIGHEST-BREAK, migration renames, and beginner examples you can test on a small payroll-style report.
BREAK-LEVEL is a system-defined numeric field maintained by the Easytrieve report writer during CONTROL break processing. You do not code DEFINE BREAK-LEVEL in your Library. The product sets BREAK-LEVEL when a control break occurs to reflect the highest break level involved in that break event. Purpose: let one shared BEFORE-BREAK procedure distinguish a minor department change from a region rollover that also closes every department and branch underneath. Without BREAK-LEVEL you might display "department totals" when the region itself is ending—a misleading heading on an executive summary.
Think of CONTROL fields stacked like nested folders: REGION is the outer folder, BRANCH is inside it, DEPT is inside branch. When only DEPT changes, the outer folders stay open. When REGION changes, every inner folder must close first. BREAK-LEVEL answers how far up the stack the closing action reached on this particular record boundary.
The BREAK-LEVEL system field is documented in Broadcom 11.6 report processing and CONTROL statement reference alongside LEVEL. The reserved-word status for migration appears on the New Reserved Words list when moving from CA Easytrieve 6.4 to 11.6 function mode. Before 11.x, some shops used BREAK-LEVEL as a working storage field name for entirely different purposes—storing a counter, a code from a flat file, or a converted COBOL name. Those definitions now collide with the language keyword and system symbol. Inventory DEFINE and FILE field lists before enabling function mode compile.
| Aspect | Detail |
|---|---|
| Category | System-defined report field; reserved keyword |
| Introduced as reserved | Easytrieve Report Generator 11.x function mode migration list |
| User DEFINE allowed | No—rename colliding field names |
| Typical reference context | BEFORE-BREAK and AFTER-BREAK report procedures |
| Related system field | LEVEL (active break level for procedure pass) |
No. Reserved status means you cannot declare a field, file label, or procedure name BREAK-LEVEL. The compiler treats the token as the system field or keyword. If your copybook contains BREAK-LEVEL 5 N or similar, replace it before migration. Common safe renames include WS-BREAK-LEVEL-NUM, RPT-HIGH-BREAK, or BRK-LVL-OUT depending on shop naming standards. Qualification does not help—you cannot write WORK:BREAK-LEVEL as a user field because the base name itself is reserved.
You can reference BREAK-LEVEL in IF tests, DISPLAY statements, MOVE to other fields, and TITLE or LINE items when you need the numeric level on output. You cannot assign to BREAK-LEVEL to fake break processing—the report writer owns its value during CONTROL events.
LEVEL tells you which break level the current BEFORE-BREAK or AFTER-BREAK invocation is formatting—level 1 is the lowest CONTROL field, higher numbers are more major, and FINAL handling applies at end of report. BREAK-LEVEL tells you the highest control field that broke on this boundary. On a region change, multiple LEVEL passes may run in sequence while BREAK-LEVEL stays at the region's level until processing completes for that boundary. Beginners often conflate them; use LEVEL to specialize logic inside one pass and BREAK-LEVEL to detect multi-level closes.
| Field | Meaning | Example use |
|---|---|---|
| LEVEL | Which break level this procedure pass handles | IF LEVEL = 1 format zip-level subtotal text |
| BREAK-LEVEL | Highest control field that broke on this boundary | IF BREAK-LEVEL = 3 show region-and-final banner |
Broadcom documents an alternative on mainframe and UNIX: instead of comparing BREAK-LEVEL to a numeric constant, test IF region-name HIGHEST-BREAK or IF branch-name HIGHEST-BREAK on a CONTROL field. That style survives when you add or remove CONTROL fields without renumbering literal level constants in procedures. IF BRANCH BREAK is equivalent to IF LEVEL equals branch's assigned level; IF BRANCH HIGHEST-BREAK parallels BREAK-LEVEL tests for whether branch was the outermost breaker. Pick one style per program for readability—mixed numeric and HIGHEST-BREAK in the same procedure confuses reviewers.
The following pattern comes from Broadcom CONTROL Reports documentation. REGION and BRANCH are CONTROL fields with BRANCH the lower level. BEFORE-BREAK runs before subtotal lines print. When only branch breaks, BREAK-LEVEL is 1. When region also breaks, BREAK-LEVEL is 2 and both branch and region subtotals appear. When FINAL runs, BREAK-LEVEL can reflect the grand total pass.
12345678910111213141516REPORT PAY-RPT SEQUENCE REGION BRANCH CONTROL REGION BRANCH LINE REGION BRANCH NAME PAY-GROSS BEFORE-BREAK. PROC IF LEVEL = 1 IF BREAK-LEVEL = 1 DISPLAY '*** BRANCH TOTALS ***' ELSE-IF BREAK-LEVEL = 2 DISPLAY '*** BRANCH AND REGION TOTALS ***' ELSE-IF BREAK-LEVEL = 3 DISPLAY '*** BRANCH, REGION, AND FINAL TOTALS ***' END-IF END-IF END-PROC
Walk through sorted input mentally: consecutive records share region and branch until a branch code changes—BREAK-LEVEL 1, branch subtotal only. When region code changes on the next record, branch subtotal for the old branch, region subtotal, and BREAK-LEVEL 2 messaging apply. DISPLAY lines help operators align paper totals with console diagnostics during test runs; production reports often MOVE literals into TITLE lines instead.
Migration scanners should flag DEFINE BREAK-LEVEL, FILE field BREAK-LEVEL, and PROC labels if your release treats labels as reserved collisions. Error messages may cite unexpected keyword or duplicate symbol. Fix by renaming and recompiling all impacted copybooks in the same change window—partial renames leave link-edit success but wrong data if two modules disagree on layout. Document renames in your program header comment block for auditors comparing 6.4 and 11.6 listings.
BREAK-LEVEL is meaningful only when CONTROL fields are declared in major-to-minor order, input records are sequenced on those fields, and PRINT feeds the report writer in that order. Unsorted files produce chaotic break sequences—BREAK-LEVEL still updates but subtotals no longer match business groups. Use SORT activity or presorted extracts. Quantitative fields belong on LINE with SUM, not on CONTROL. NOPRINT on a break level suppresses subtotal lines but does not skip BEFORE-BREAK—your DISPLAY may still run.
Imagine sorting your toys into big boxes (regions), smaller boxes inside (branches), and little bags (departments). When you finish one bag and start another, that is a small break. When you close a whole small box, that is a bigger break. BREAK-LEVEL tells you whether you only changed bags or you also closed a bigger box. The Easytrieve robot keeps that number for you so your program can say the right sentence before printing subtotals. You cannot name your own toy BREAK-LEVEL because that is the robot's special word.
1. BREAK-LEVEL is reserved because:
2. BREAK-LEVEL contains:
3. When REGION and BRANCH both break on one boundary, BREAK-LEVEL is typically:
4. A legacy DEFINE field named BREAK-LEVEL after 11.6 upgrade:
5. An alternative to IF BREAK-LEVEL = n is: