Compiler Directive Statements Interview Questions


What is the compiler-directive statement?

Compiler-directing Statements (often called "directives") provide instructions to the COBOL compiler about how the program should compile and produce the desired object code.

What is SSRANGE, and NOSSRANGE?

SSRANGE is used to locate a subscript that is out of range and manage array overflow.
NOSSRANGE ensures no run-time error if a subscript or index is out of range.

Explain the terminologies - AMODE(24), AMODE(31), RMODE(24), and RMODE(ANY)?

  • AMODE(24) - 24 bit addressing. AMODE(31) - 31 bit addressing.
  • AMODE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE.
  • RMODE(24) - Resides in virtual storage below 16 Meg line. Use this for 31 bit programs that call 24 bit programs. (OS/VS Cobol pgms use 24 bit addresses only).
  • RMODE(ANY) - Can reside above or below 16 Meg line.

COPY Statement -

What is a COBOL copybook?

Copybook is a peice of code which can contain file structure or PROCEDURE DIVISION code (paragraphs or sections).

What is the COPY statement?

COPY statement includes predefined copybooks (usually file record structures) from the library that is outside of the program.

EXIT Statement -

What does EXIT do?

EXIT statement is a "do-nothing" statement mainly used for readability and structure, giving a logical endpoint for a section or paragraph.

EJECT Statement -

What does EJECT do?

EJECT statement specifies that the next source statement after it should be printed as the first statement of the next page while printing.

SKIP Statement -

What does SKIP do?

SKIP1, SKIP2, or SKIP3 statements specify the number of blank lines that should replace the SKIP statement while listing the COBOL source code.

Frequently Asked Questions -

How is SSRANGE different from NOSSRANGE?

Explain the advantage of using a copy book in programming?
What is the use of the COPY statement in COBOL, and how can it be used to modularize and reuse code?
What is the use of the COPYBOOK statement in COBOL, and how can it be used to include external files and libraries?

What is the use of the EXIT statement in COBOL, and how can it be used to terminate programs and subprograms?