Skip to main content

Compilation details

Files created by the COBOL compiler

When the COBOL compiler is invoked this creates a number of files. In our Bankdemo application each COBOL program will be complied to produce 3 files.

File type

Function

.DLL Dynamic link library

Effectively the executable module created for each  program by the compiler.

.IDY Debugger info

The file created by the compiler which allows  debugging of the module. Only produced if Compile for debugging is turned on.

.OBJ Object file

Temporary file, created by the compiler on its way  to producing the DLL. These files can be deleted

Producing COBOL Compiler Listing file

If you want a fully expanded compiler listing file to be created after each compile then this is easily achieved. Let us assume that we want to do this just for 1 program ZBNKPRT1.cbl

1.       In the COBOL Explorer in Eclipse right-click on the COBOL program ZBNKPRT1.cbl and choose Properties.

2.       Select COBOL

3. Turn on Enable file specific settings and enter the value LIST() in the Additional Directives

 

This is an example of turning on a directive at component level

What will happen now is that when this program ZBNKPRT1.cbl is compiled, the compiler will produce a source listing file ZBNKPRT1.lst, in the same location as the original source file. (In our case this is C:\\MFETDUSER\\Bankdemo\\Sources\\cbl).

This listing file will include a fully expanded source file together with some compiler system information at the start and any compiler errors highlighted with asterisks. You can view it from Windows Explorer and looking at the file in a text editor such as Microsoft Notepad.

Example of Compiling a COBOL Program with errors

We will just introduce a couple of compilation errors into one of the programs to see how the compiler handles this. So:

1.       In the COBOL Explorer in Eclipse double click on the COBOL program ZBNKPRT1.cbl

2.       This will bring up the Editor window for this program. Page down the program a few pages to the start of procedure division around line 021600.

3.       Now let's make a couple of syntax errors: On line 21800 change RUN-TIME to RUN-TME On line 22100 change SPACES to SPOCES On line 22900 place a period after the END-IF This will give you the results shown here:

4.       You will see that your errors have been highlighted. Hover your mouse over each of the red crosses in turn to see what the errors are.

5.       Now save the program and see that the build will take place. The message in the console window shows that there are errors.

6.       Click on the Problems Tab to expand the error list.

7.       Double click on any of these errors and you will be taken to the line of code containing the error.

8.       If you wish, you can look at the listing file ZBNKPRT.lst. This file has been created in the same folder as the COBOL source file, which is C:\\MFETDUSER\\Bankdemo\\Sources\\cbl. You will need to use a text editor to view this file. You will see your syntax errors highlighted:

9.       Finally fix your errors and save the file. The build will happen and no errors will be found.

 

See Next: BMS Compiler Control


#EnterpriseDeveloper
#Eclipsesyntaxchecking
#MFDS