SKIP2 creates a stronger visual break—two blank lines—between major sections such as report chapters, company divisions, or monthly subtotals.
1WRITE PRINT-REC AFTER ADVANCING 2 LINES
Equivalent to adding two blank lines before the next record is printed.
1234IF LINE-COUNTER > PAGE-LIMIT - 2 WRITE PRINT-REC AFTER ADVANCING PAGE END-IF WRITE PRINT-REC AFTER ADVANCING 2 LINES
1234501 BLANK-LINE TYPE DETAIL. 05 FILLER PIC X. ... GENERATE BLANK-LINE GENERATE BLANK-LINE *> SKIP2 via two blank details
Mistake | Problem | Fix |
---|---|---|
Overuse of SKIP2 | Wasted space | Adopt spacing guidelines |
No page-guard | Breaks sections across pages | Check LINE-COUNTER |
Action | Syntax | Example |
---|---|---|
Two blank lines | WRITE ... AFTER ADVANCING 2 LINES | WRITE PRINT-REC AFTER ADVANCING 2 LINES |
Guard | IF LINE-COUNTER > PAGE-LIMIT - 2 | Advance PAGE first |
1. COBOL equivalent of SKIP2?
2. What should you check before SKIP2?