Find file History
Latest commit c4dd8bd Aug 26, 2015 @ajlopez Updated sample README.md

README.md

Hello Sample

The clasical program, using display verb.

Setup

Install Node.js.

Run

With the command line:

node run hello.cob

The output:

Hello, world

hello.cob is simple

display "Hello, world".

With the command line:

node compile hello.cob

The output is:

runtime.display("Hello, world");

The runtime is an object provided by CobolScript implementation.

CobolScript doesn't enforce to have all the common COBOL declarations: identification division, environment division, data division and procedure division. You can write directly the commands.

It supports a more complete program hello2.cob:

 IDENTIFICATION DIVISION.
       PROGRAM-ID. HELLO.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       PROCEDURE DIVISION.

       PROGRAM-BEGIN.
           DISPLAY "Hello world".

       PROGRAM-DONE.
           STOP RUN.