Are .int files executable ?

I have compiled the cobol programs (.cbl files) using visual cobol for eclipse. After compiling the program I have .int files which are intermediate files.

Can I export these to Linux and execute them by UNIX script?

If these can't be used directly can someone please let me know how to convert them to .o files ?

  • Verified Answer

    .int files can be executed with the Micro Focus COBOL runtime on the Linux machine if they were produced on a like UNIX/Linux machine with the "cobrun" command.

    Compiler directives can be set to produce .o files instead, but these need to be linked into an executable.
  • Verified Answer

    As long as the compilation and run are both in 32-bit COBOL environments or both 64-bit, .int files should be portable between platforms. They can be run on UNIX/Linux using "cobrun" in the same way that you would use the "run" command on Windows - so yes, certainly you can export them to Linux and use cobrun in your script. Conversely you could compile to .int on UNIX and run that file on a Windows machine.

    And if you have your program compiled to compatible .int code, you can then compile that .int file to native code. So if you wanted to produce an object file you could use "cob -xc myprog.int" if you were going to link it into an executable, or "cob -zc myprog.int" if you were going to link it into a shared object. This part needs to be done on the same platform where the program will run - .int files are portable, .o files are not!
  • What should the compiler directives be set to produce .o files and how to link them to executable?
    Can't we use .o files as executable ?
  • .o files are not executable but are the next step towards an executable. Unless your build is complex, you should be able to go directly to executable rather than paying attention to the .o file in between.

    You can produce an executable from a COBOL source file:
    cob -x myprogram.cbl

    or from a .int file (which, as discussed above, may have come from another machine):
    cob -x myprogram.int

    I have given a fuller answer under your other question on the subject:
    community.microfocus.com/.../29663