Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Write a record to a sequential file.
IDENTIFICATION DIVISION.
PROGRAM-ID. WRITE-FILE.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT OUT-FILE ASSIGN TO 'OUTPUT.DAT'
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD OUT-FILE.
01 OUT-REC PIC A(30).
WORKING-STORAGE SECTION.
01 MESSAGE PIC A(30) VALUE 'Hello COBOL World'.
PROCEDURE DIVISION.
OPEN OUTPUT OUT-FILE.
MOVE MESSAGE TO OUT-REC.
WRITE OUT-REC.
CLOSE OUT-FILE.
STOP RUN.COBOL Variants refer to the different dialects and implementations of COBOL (Common Business-Oriented Language), a legacy programming language widely used in business, finance, and administrative systems.
Origin & Creator
Developed in 1959 by a consortium including CODASYL and led by Grace Hopper to provide a standardized business programming language.
Industrial Note
Extensively used in banking, insurance, government payroll systems, and mainframe applications where decades-old COBOL systems still operate mission-critical workloads.