How to generate compile listing (Expanded copybook and subroutine) in Visual Cobol 9.0 and above VS 2022

I would like to see compile listing (Expanded copybook, subroutine, Include statements, Embedded SQLs) of each COBOL program as .lis (extension) or .lst similar in Visual Cobol 9.0 and above VS 2022.

Normally, Micro Focus under Linux/Unix net Express environment generate the .lis file upon successful compilation.

  • 0  

    You can generate a .lst file for a program which will contain the source and expanded copy and include statements by using the LIST() directive. If using the Visual Studio IDE you can simply check the option for Generate Listing on the COBOL tab of the project Properties page.

    I am not sure exactly what you mean by subroutine and embedded SQL. .LST files are per program so if you wanted to show subroutines which reside in separate programs you would have to generate a .LST file for each one. Embedded SQL statements will appear in the listing as they are in the program. If you wish to see the actual code that is generated by the SQL preprocessor, you can do that but how, really depends on which preprocessor you are using, OpenESQL, COBSQL/ProCOB, DB2?

    Other directives that affect the contents of the listing file can be found here.

    Chris Glazier
    Rocket Software - Principal Technical Support Specialist
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button