SKIP Statement
SKIP Statement
SKIP1, SKIP2, or SKIP3 statements specify the number of blank lines that should replace the SKIP statements while listing the COBOL source code. These statements are compiler-directive statements and do not affect the compilation and execution of the program.
These statements can be written in either Area-A or Area-B. These statements can code only one statement per line.
Syntax -
SKIP1[.]
SKIP2[.]
SKIP3[.]
Note! All statements coded in [ ] are optional.
Parameters -
- SKIP1 - Inserts a single blank line in the source listing.
- SKIP2 - Inserts two blank lines in the source listing.
- SKIP3 - Inserts three blank lines in the source listing.
Examples -
Scenario1 - Coding SKIP1 statement in COBOL program.
Code -
----+----1----+----2----+----3----+----4----+----5----
01 EMP-REC.
COPY EMPREC.
SKIP1.
01 WS-VAR.
05 WS-INPUT1 PIC X(10).
Explaining Example -
- The SKIP1 statement won't display in the program listing.
- The SKIP1 inserts one blank line before WS-VAR declaration line in the program listing.
Scenario2 - Coding SKIP2 and SKIP3 statements in COBOL program.
Code -
----+----1----+----2----+----3----+----4----+----5----+
01 EMP-INPUT-REC.
COPY EMPREC REPLACING
"==:EMP:==" BY "==EMP-INPUT==".
SKIP2.
01 EMP-OUTPUT-REC.
COPY EMPREC REPLACING
"==:EMP:==" BY "==EMP-OUTPUT==".
SKIP3.
01 WS-VAR.
05 WS-INPUT1 PIC X(10).
Explaining Example -
- The SKIP2 and SKIP3 statements won't display in the program listing.
- The SKIP2 inserts two blank lines before EMP-OUTPUT-REC declaration line.
- SKIP3 inserts three blank lines before WS-VAR declaration.