Is it possible to make my cobol program to executable file or having .bat? just like in java they have .jar file.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Either COBOL.EXE or COMPILE.BAT in MS-COBOL 2.20 can create an intermediate file.
If your source code is HELLO.COB, use either:
or
Both commands will produce the intermediate file HELLO.INT.
The intermediate file can be run with
That command could be put into a .BAT file to create an “executable” file that might fit your need.
MS-COBOL 2.20 also comes with LINK.EXE that should be able to turn HELLO.INT into HELLO.EXE. I could not get it to work on Windows XP. MS-COBOL 2.20 was written for DOS, not Windows, so I am not surprised.
All that being said, please do not use MS-COBOL 2.20. It is very old and there is little documentation available. For Cobol on the PC, Microfocus and Fujitsu have good compilers, but you need to pay for them at some point. I use and recommend OpenCobol, which is open source. It is available for free for Windows and Linux and has good documentation. Please see opencobol.org. The direct link to the documentation is http://opencobol.add1tocobol.com/OpenCOBOL%20Programmers%20Guide.pdf. A fast way to get OpenCobol on WindowsXP is using OpenCOBOL-1.1-06FEB2009-mingw.zip (see link and instructions near the bottom of http://www.opencobol.org/modules/bwiki/index.php?Assorted%20Documents).