Summary -

In this topic, we described about the Compiler-directive Statements with detailed example.

A compiler-directive statement that causes the compiler to take a specific action during compilation. We can use compiler-directive statements for the below purposes -

  • Extended source library control (BASIS, DELETE and INSERT statements).
  • Source text manipulation (COPY and REPLACE statements).
  • Exception handling (USE statement).
  • Controlling compiler listings (*CONTROL, *CBL, EJECT, TITLE, SKIP1, SKIP2 and SKIP3 statements).
  • Specifying compiler options (CBL and PROCESS statements).
  • Specifying COBOL exception handling procedures (USE statements).

The following compiler directive statements have no effect - ENTER, READY or RESET TRACE and SERVICE RELOAD. Below is the list of compiler-directive statements -

  • BASIS statement
  • CBL (PROCESS) statement
  • *CONTROL (*CBL) statement
  • COPY statement
  • DELETE statement
  • EJECT statement
  • ENTER statement
  • INSERT statement
  • READY or RESET TRACE statement
  • REPLACE statement
  • SERVICE LABEL statement
  • SERVICE RELOAD statement
  • SKIP statement
  • TITLE statement
  • USE statement