DISPLAY / DIVISIONs
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
Loading editor…
Expected output
Hello World
When to use?
Output, message.
Common mistakes
- ⚠️ Fixed format: DIVISION lines 7 spaces, statements further indented (~11 spaces).