MainframeMaster

COBOL Tutorial

SKIP1 - Insert One Blank Line

Progress0 of 0 lessons

What is SKIP1? Why use it?

SKIP1 means “add one blank line” in printed reports to improve readability. Use it between logical sections, after headings, or before totals so the page isn’t visually cramped.

📄 Analogy

Like pressing Enter once in a document editor to leave a blank line between paragraphs.

How to implement SKIP1 in COBOL

Basic pattern

cobol
1
WRITE PRINT-REC AFTER ADVANCING 1 LINE

This advances the paper by one line, effectively inserting a blank line before the next printed record.

Printing a separator then SKIP1

cobol
1
2
3
MOVE ALL '-' TO PRINT-REC WRITE PRINT-REC *> prints dashes WRITE PRINT-REC AFTER ADVANCING 1 LINE *> SKIP1

Using LINAGE and LINE-COUNTER

cobol
1
2
3
4
5
6
7
8
FD REPORT-FILE RECORD CONTAINS 132 CHARACTERS LINAGE IS 60 LINES WITH FOOTING AT 58. ... IF LINE-COUNTER > 56 WRITE PRINT-REC AFTER ADVANCING PAGE *> start new page before spacing END-IF WRITE PRINT-REC AFTER ADVANCING 1 LINE *> SKIP1 safely

LINAGE defines page length; LINE-COUNTER tracks where you are. Guarding SKIP1 avoids splitting logical blocks at page end.

Alternatives with Report Writer

If you use Report Writer, place blank lines in PAGE HEADING/FOOTING or define an empty DETAIL group.

cobol
1
2
3
4
5
6
7
REPORT SECTION. RD SALES-RPT. 01 BLANK-LINE TYPE DETAIL. 05 FILLER PIC X. ... GENERATE SALES-RPT *> emits detail lines GENERATE BLANK-LINE *> SKIP1 via blank detail

Real-World Scenarios (Non-Code)

  • Insert SKIP1 between department sections in a payroll report
  • Add SKIP1 before a subtotal to visually separate from detail rows
  • Use SKIP1 after a page heading to create breathing room

Best Practices and Common Mistakes

Best Practices

  • Keep vertical spacing consistent per report
  • Use LINAGE and guard near page end
  • Prefer Report Writer for complex reports

Common Mistakes

MistakeProblemFix
Unconditional SKIP1 at page endOrphans a line on next pageCheck LINE-COUNTER; advance PAGE first
Too many blank linesSparse, wasteful pagesAdopt spacing guidelines

SKIP1 Quick Reference

ActionSyntaxExample
One blank lineWRITE ... AFTER ADVANCING 1 LINEWRITE PRINT-REC AFTER ADVANCING 1 LINE
Guard near page endIF LINE-COUNTER >= limit THEN ADVANCING PAGEIF LINE-COUNTER > 56 WRITE ... AFTER ADVANCING PAGE

Test Your Knowledge

1. What does SKIP1 represent conceptually?

  • Add one blank line in printed output
  • Skip to next page
  • Clear screen
  • Increment a counter

2. COBOL way to do SKIP1?

  • WRITE AFTER ADVANCING 1 LINE
  • DISPLAY AT 1,1
  • ACCEPT WITH UPDATE
  • SORT

3. Which clause governs pagination automatically?

  • LINAGE
  • USAGE
  • REDEFINES
  • SYNC

Frequently Asked Questions