Single file multi-program support in the IDE

Within COBOL, there is support for a single source file to contain more than one complete program. If your program utilizes user-defined functions, these too must be coded within the same file.

When you compile a project that contains a multi-program source file, that source file generates a number of artifacts depending on the target type of the project. The following section details how to set the main execution entry point for one of these files, depending on the target type:

All Int/Gnt Files
Each program within a multi-program source file produces a symbols file (.idy file) and an intermediate file (.int file). The main entry point for the final executable can be specified in the main program field of the build configuration.

Entry point selection for multi-program support

Single Executable File or Single Native Library File
All programs within a multi-program source file are compiled into a single executable or library file, using the name of the project. The main entry point for the final executable/library can be specified in the main program field of the build configuration.
All Executable Files or All Native Library Files
Each source file compiles to an individual executable or library. For a multi-program source file, all programs are compiled into a single executable or library file (as above), but the main entry point is specified within the source file's properties:
  1. In COBOL Explorer, right-click the source file and select Properties.
  2. From the Properties dialog box, select Link, select Enable file specific settings, and then edit the value of the Entry point field to the name of the required program.

    Entry point for multi-program source files