Continuation Line


A line with more than 72 characters needs to be split into multiple lines. A continuation line that continues from the previous line should have a hyphen (-) in column 7.

The first line that splits into multiple lines is called the Continued Line, and the following lines are called the Continuation Lines. For example -

If no hyphen (-) in column-7 for continution line, until the last character of the continued line is assumed as end of the line. For example -

Rules to Remember -

  • Pseudo-text delimiter separator (==), floating comment indicator (*>), or compiler directive indicator (>>) should not be separated and must be on the same line.
  • If the continued line contains an alphanumeric literal without a closing quotation mark, all spaces till the end of the line (through column 72) are part of the literal.

    For example -
  • If the last character on the continued line is a quotation mark, the continuation line should start with a quotation mark in Area-B.

    For example -

Practical Example -


Scenario - Explaining multiple ways of using continution lines.

Code -

----+----1----+----2----+----3----+----4----+----5----+
       ...
       DATA DIVISION. 
       WORKING-STORAGE SECTION. 
       01 WS-CONT-LINE1 PIC X(160) VALUE "THIS PART IS CONTINUED LINE & 
      -    "THIS PART IS CONTINUTION LINE1............................. 
      -    "THIS PART IS CONTINUTION LINE2". 
       01 WS-CONT-LINE2 PIC X(120) VALUE "THIS IS CONTINUED LINE &
      -    " THIS PART IS CONTINUTION LINE1".
       01 WS-CONT-LINE3 PIC X(120) VALUE "THIS PART IS CONTINUED LINE &"
      -    ""THIS PART IS CONTINUTION LINE1".
       01 WS-CONT-LINE4 PIC X(120) VALUE "THIS IS CONTINUED LINE & ".
       ...
       PROCEDURE DIVISION.
           DISPLAY "DISPLAYING CONTINUTION LINE1: " WS-CONT-LINE1.
           DISPLAY "DISPLAYING CONTINUTION LINE2: " WS-CONT-LINE2.
           DISPLAY "DISPLAYING CONTINUTION LINE3: " WS-CONT-LINE3.
           DISPLAY "DISPLAYING CONTINUTION LINE4: " WS-CONT-LINE4.
		   ...

Output -