Skip to content

writ3it/cobol-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cobol-examples

(under construction)

The set of cobol examples

Requirements

PC with linux OS and Vagrant installed. If you are using Windows, translate bin/buildAndRun.sh and bin/mf-terminal.sh (or run over WSL?).

Getting Started

  1. Install Vagrant (documentation).
  2. Clone this repository and open repo directory in VSC.
  3. Install extensions:
  • Language support ext install bitlang.cobol (description)
  • GnuCobol support ext install bitlang.gnucobol (description)
  • COBOL flow visualization ext install broadcomMFD.ccf (description)
  1. Do in the terminal $ vagrant up.
  2. Open selected program in VSC.
  3. Type Ctrl + Shift + B. Enjoy!
  4. After work, do $ vagrant halt to stop virtual machines.

Table of Contents

  1. examples/gnucobol - gnucobol dedicated examples
  2. examples/mainframe - Hercules dedicated examples
  3. Mainframe/Printers - Hercules printers output files
    • prt00e.txt - A device

GnuCobol doesn't support OOP yet.

Environment architecture

Environment architecture diagram

Building (Ctrl+Shift+B)

When you type Ctrl + Shift + B, vscode will execute build task that runs buildAndRun.sh. That magic script looking for JCL corresponding to your CBL file. If the JCL is found then your program will be transfer to the mainframe and submit using JCL. If not, your program will be compile with gnuCobol. Each CBL file is precompiled with esqlOC.

ATTENTION

This repository is under development. Currently building a program using the mainframe does not support copybooks. The connection to mariadb has not been tested. VMs builded with Vagrantfile are not secured. Do not use them for sensitive data or production purposes. Building script lacks of error checking.

Important questions and answers

What is the mainframe?

The mainframe is a large computer designed to process large amounts of business data and I/O operations. Detailed answer.

Why mainframe variant of buildAndRun is so weird?

The actual compilation and running of the program are run in the job queue processed by the mainframe. This makes the process asynchronous to VSCode. Also for this reason, the program output is available on the output device (usually the printer) and not on the terminal. See compilation using the old mainframe. Hercules works similarly.

Probably this process will be improved in the future.

How to log into Hercules?

Type ./bin/mf-terminal.sh in your terminal. The default user (f.e.) is HERC02 (password: CUL8TR). After finishing work REMEMBER to LOGOFF (before disconnecting).

Usefull docs

  1. Picture symbols
  2. Awesome COBOL list!

About

The set of cobol examples

Topics

Resources

Stars

Watchers

Forks