       IDENTIFICATION DIVISION.
       PROGRAM-ID. FileTest.
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT OUT-FILE ASSIGN TO "cobol_fileio_out.txt"
               ORGANIZATION IS LINE SEQUENTIAL
               FILE STATUS IS FS.
       DATA DIVISION.
       FILE SECTION.
       FD OUT-FILE.
       01 OUT-REC PIC X(20).
       WORKING-STORAGE SECTION.
       01 FS PIC X(2).
       PROCEDURE DIVISION.
           OPEN OUTPUT OUT-FILE
           DISPLAY FS
           MOVE "hello file" TO OUT-REC
           WRITE OUT-REC AFTER ADVANCING 1 LINES
           DISPLAY FS
           CLOSE OUT-FILE
           DISPLAY FS
           OPEN INPUT OUT-FILE
           READ OUT-FILE
           DISPLAY FS
           DISPLAY OUT-REC
           READ OUT-FILE
           DISPLAY FS
           CLOSE OUT-FILE
           DISPLAY FS
           STOP RUN.
