COBOL programmers speak in paragraphs; Easytrieve programmers speak in labels, PROCs, and activities. The word paragraph in Easytrieve tutorials usually means a named block of logic inside an activity—a set of statements that implement one business rule group, often entered through a statement label and sometimes reached with GOTO. Unlike formal PROC modules, paragraphs in this sense are lightweight organizational units. Understanding when to use labels, when to upgrade logic into PERFORM PROCs, and when GOTO JOB skips a record helps you read legacy source and write clearer new programs.
Within a JOB or PROGRAM activity, you can place a statement label on its own line before a group of related statements. The label acts as a paragraph name. Other statements use GOTO label to transfer control there. Labels identify PROGRAMs, JOBs, PROCs, REPORTs, SCREENs, and individual statement groups per Broadcom labeling rules. A label can be up to 128 characters, must not be all numeric, and cannot contain delimiter characters.
1234567891011121314JOB INPUT PERSNL NAME DIV-LIST IF DIV EQ 'A' GOTO JOB END-IF IF DIV EQ 'B' GOTO CHECK-REGION END-IF PRINT DETAIL-RPT CHECK-REGION IF REGION EQ 'NE' GOTO JOB END-IF PRINT DETAIL-RPT
CHECK-REGION is a paragraph entry point. When DIV is B, GOTO CHECK-REGION skips generic processing and runs region validation. GOTO JOB sends control back to the top of the JOB activity—typically to read the next record—without executing trailing statements for the current record. This pattern filters records early.
| Aspect | Labeled paragraph | PROC module |
|---|---|---|
| Entry | Statement label | proc-name. PROC |
| Invocation | GOTO label | PERFORM proc-name |
| Return | Manual branch or fall-through | Automatic at END-PROC |
| Best for | Local branching within linear flow | Reusable callable tasks |
If the same block is needed from multiple places, a PROC with PERFORM is usually cleaner than multiple GOTO lines pointing to one label. If you need to abandon the current record immediately, GOTO JOB is idiomatic. Paragraph-style labels still help readability even when no GOTO references them—reviewers see CHECK-REGION as a named section.
The Activity section as a whole can contain many paragraph-like tasks: validation, calculation, extract write, and report trigger. Mainframe training material often calls each task a paragraph even when implemented as straight-line IF logic without labels. Modular thinking matters more than the keyword. Group statements visually with blank comment lines and consistent indentation so each business rule reads as its own paragraph block.
GOTO accepts a user label, GOTO JOB, or GOTO SCREEN. GOTO JOB jumps to the top of the current JOB activity—useful to stop processing the current input record. GOTO SCREEN restarts the current SCREEN activity including BEFORE-SCREEN processing in online programs. GO TO is accepted as a synonym for GOTO. Labels referenced by GOTO must reside in the same activity or PROC as the GOTO statement.
Broadcom structured programming guidance promotes IF/ELSE, DO WHILE, DO UNTIL, CASE, and PERFORM instead of dense GOTO webs. Indent nested IF blocks so paragraph structure is visible without labels. Compare poorly indented flat IF chains with indented equivalents in the structured programming documentation—the logic is identical but maintenance cost differs. Modernize legacy GOTO paragraphs gradually by extracting PERFORM PROCs while preserving behavior with regression tests.
Report PROCs such as BEFORE-LINE behave like event-driven paragraphs the report writer calls automatically—they are not reached by your GOTO. SCREEN activities use INITIATION, BEFORE-SCREEN, and AFTER-SCREEN PROCs similarly. When documentation says paragraph in reporting context, it may mean these special PROC hooks rather than user labels. Context determines which mechanism applies.
Older Easytrieve programs may chain many GOTO targets across hundreds of lines. Trace flow by drawing arrows from each GOTO to its label. Identify unreachable statements after unconditional GOTO. Check whether a label is only used once—candidate for inline IF logic or a PROC. SYSPRINT compile listings show statement numbers that pair with DEBUG STATE when runtime issues appear in labeled sections.
Imagine a choose-your-own-adventure book. Each paragraph is a page with a title at the top. GOTO is the instruction jump to page CHECK-REGION. GOTO JOB is jump back to the beginning of this chapter and start the next story piece. A PROC is like a side booklet you read completely and then automatically return to where you left off. Paragraphs name the pages; PROCs are mini-books you borrow and return.
1. In Easytrieve, a paragraph entry point is usually marked by:
2. GOTO label transfers control to:
3. Paragraphs differ from PROCs because PROCs:
4. GOTO JOB branches to:
5. Structured programming guidance favors: