Cevela about COBOL COBOL language - Home - Site Map - About Cevela - MX COBOL    <prev   next>
First steps - (demo a)
For more see - Formats in detail + Summary comment + How to use MX COBOL demos.

Display "Hello" with stop
000000*..1....*....2....*....3....*....4....*....5....*....6....*....7..
      * Greeting - with stop                                    mx_a1.cb
      *
       procedure division.
           stop "Hello world.".
           stop run.
    
MX COBOL + C compile listings - see here

Display "Hello" without stop
000000*..1....*....2....*....3....*....4....*....5....*....6....*....7..
      * Greeting - without stop                                 mx_a2.cb
      *
       procedure division.
           display "Hello world.".
           stop run.
    
executing by means of this cmd-file:
000000*..1....*....2....*....3....*....4....*....5....*....6....*....7..
@echo off
rem                                                            mx_a2.cmd
rem     Greeting - without stop (starting command file)
mx_a2.exe
echo.
pause
    
MX COBOL + C compile listings - see here

Simple dialog
000000*..1....*....2....*....3....*....4....*....5....*....6....*....7..
      * Simple dialog - with "accept" as stop at end            mx_a3.cb
      *
       working-storage section.
       77  INP pic x(20).
       77  OUT pic x(50) value space.
      *
       procedure division.
           display "Give me your name, please:".
           accept INP.
      *
           string
              "Hello, " delimited size
              INP delimited space
              " - have a nice day." delimited size
              into OUT.
      *
           display OUT.
           accept INP.
           stop run.
    
MX COBOL + C compile listings - see here

MX COBOL - free compiler - © Vlastimil Cevela 2006

Date 2006-06-04 - Text Builder 0.65 - Time 06:30:52