Highlighted
Absent Member.
Absent Member.
1042 views

Are .int files executable ?

Jump to solution

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 ?

0 Likes
2 Solutions

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

RE: Are .int files executable ?

Jump to solution
.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.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Are .int files executable ?

Jump to solution
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!

View solution in original post

0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

RE: Are .int files executable ?

Jump to solution
.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.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Are .int files executable ?

Jump to solution
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!

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Are .int files executable ?

Jump to solution
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 ?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Are .int files executable ?

Jump to solution
.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
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.