HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to COBOLVariablesArithmeticConditions (IF)Loops (PERFORM)
REFERENCE
📖 Overview
🖥️ Structure & Output
DISPLAY / DIVISIONs
📦 Variables
🔢 Arithmetic
🔀 Condition
🔁 Loop
COBOL›REFERENCE›Structure & Output
🖥️

Structure & Output

Program divisions and DISPLAY.

CommandDescription
DISPLAY / DIVISIONsWrites to the screen; the program is divided into DIVISIONs.

DISPLAY / DIVISIONs

Try it yourself →

Writes to the screen; the program is divided into DIVISIONs.

Syntax

DISPLAY value.

Description

Every COBOL program is divided into divisions (DIVISION): IDENTIFICATION (name), DATA (data), PROCEDURE (commands). DISPLAY writes to the screen. Every statement ends with a period (.). STOP RUN ends the program.

Example

       IDENTIFICATION DIVISION.
       PROGRAM-ID. HELLO.
       PROCEDURE DIVISION.
           DISPLAY "Hello World".
           STOP RUN.

Expected output

Hello World

When to use?

Output, message.

Common mistakes

  • ⚠️ Fixed format: DIVISION lines 7 spaces, statements further indented (~11 spaces).
HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code