IDENTIFICATION DIVISION.
PROGRAM-ID. Logging.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT LogFile ASSIGN TO 'logfile.log'
        ORGANIZATION IS LINE SEQUENTIAL.

DATA DIVISION.
FILE SECTION.
FD  LogFile.
01  LogRecord.
    05 LogMessage PIC X(80).

WORKING-STORAGE SECTION.
01 WS-LogMessage PIC X(80).

PROCEDURE DIVISION USING WS-LogMessage.
    OPEN OUTPUT LogFile.
    MOVE WS-LogMessage TO LogRecord.LogMessage.
    WRITE LogRecord.
    CLOSE LogFile.
    STOP RUN.
