Initiating Compilations from COBOL

COBOL does not include any statement specifically for initiating compilations. However, a COBOL program can submit a WFL job that includes a COMPILE statement. Alternatively, a COBOL program can initiate a compiler like any other program, with a CALL, PROCESS, or RUN statement.

A compiler takes a single, star (*)-bounded array parameter with the following format:

Word

Field

Name

Value and Description

0

[47:01]

CANDECALLED

Selects different default values for some compiler control options

8

[09:10]

COMPILETYPE

Specifies the code file disposition. The following values are accessible:

  • 0 or VALUE(COMPILEANDGO): compiles and executes the program.

  • 1 or VALUE(SYNTAX): compiles the program for syntax only.

  • 2 or VALUE(LIBRARY): compiles the program and creates a code file.

  • 3 or VALUE(LIBRARYANDGO): compiles the program, creates and executes the code file.

Notes:
  • The array must be at least 30 words long and not paged.

  • All other words and fields must be zero.

 Caution

Failure to have all zeros in the remaining words of the array can lead to unexpected results at compile time or run time.