Search code examples
cobolzos

Embedding Compiler Options in source


I am moving some COBOL code from zOS to Linux and stumbled on this code at the top of a COBOL program:

   CBL DATEPROC(FLAG),YEARWINDOW(-90)                               004220CB
   ID DIVISION.                                                     004220CB
   PROGRAM-ID.   AL0001.                                            004220C

Are those compiler options that the COBOL compiler detects, or are they instructions to some kind of third party preprocessor.

My personal guess is that it is a third party processor that deals with Y2K issues in the code.


Solution

  • With IBM's Enterprise COBOL the CBL statement is one of several ways to provide compiler-options.

    The options in your example are a bit of a special case since IBM dropped Y2K-support and thus the DATEPROC and YEARWINDOW options when moving from version 4 to version 5. With V5 compilers they should be flagged by the compiler but should not lead to a compile-error.