COBOL/Building and Running a Native IDE

From Wikiversity
Jump to navigation Jump to search

If you wish to use an Integrated Development Environment (IDE) that runs on your computer rather than the simpler but more limited web-based systems follow the instructions given here. Although this is more difficult than using the web-based system, it is more flexible, more extensive, and better represents production systems.

Source code must be compiled before it can be run. Several COBOL compilers are available; this course will use GnuCOBOL in the examples.

Assignment[edit | edit source]

Download and install the GnuCOBOL system and use it to compile and execute the Hello World program by following these steps.

  1. Download GnuCOBOL from: https://sourceforge.net/projects/open-cobol/
    1. For Windows 10, it may be easiest to use the link at: https://launchpad.net/cobcide/4.0/4.7.6/+download/OpenCobolIDE-4.7.6_Setup.exe
  2. Install OpenCobolIDE and run it.
  3. Cut and paste the Hello World source code into the editor window. (The editor window may already contain a similar program. You can use that, adapt that, or overwrite it.)
  4. Save the program (File / Save As) to your computer as file type .cbl
  5. Ensure the file name does not include any spaces. For example it is acceptable to name the program HelloWorld.cbl or Hello_World.cbl but Hello World.cbl will not work. This is essential because the system treats spaces in the program name as representing a new parameter.
  6. Ensure the “Executable” option is selected under the hammer symbol in the toolbar.
  7. Use the Circular arrows symbol to build the executable. Note the “compiler” tab in the logs section of the IDE should indicate the build is up-to-date. The issues tab should not be identifying any problems.
  8. Use the green arrow symbol to run (execute) the program. Inspect the Output tab in the Logs section. It should contain the “Hello world” string; the intended output of the program.
  9. Note that this IDE is column-sensitive. Read and follow the column significance information. This often requires adding six or seven spaces to the start of each program line before it can be complied in this environment.