       ID  DIVISION.
       PROGRAM-ID. CBREAD1.
       AUTHOR. UNIKIX.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT  INPREC1  ASSIGN TO EBMINP1
                            ORGANIZATION IS SEQUENTIAL
                            ACCESS IS SEQUENTIAL
                            FILE STATUS IS INPREC1-STATUS.
       DATA DIVISION.
       FILE SECTION.
       FD  INPREC1.
       01  INP-ACCTREC.
           02  INP-DOACCT               PIC 9(9) COMP.
           02  INP-DOSNAME              PIC X(18).
           02  INP-DOFNAME              PIC X(12).
           02  INP-DOMI                 PIC X.
           02  INP-DOTTL                PIC X(4).
           02  INP-DOTEL                PIC X(10).
       WORKING-STORAGE SECTION.
       01  INPREC1-STATUS         PIC  9(2) VALUE ZEROES.
       01  CONDCODE               PIC S9(4) COMP.
       01  COUNTREC               PIC 9(9) COMP.
       01  MOD-COUNTREC           PIC 9(9) COMP.
       01  DISPLAY-RECS           PIC 9(1) VALUE 1.
       PROCEDURE DIVISION.
         OPEN INPUT INPREC1.
         IF INPREC1-STATUS NOT = 00 GO TO ABTPRIMSEQINP1.
         MOVE 0 TO COUNTREC.
         DISPLAY '================================================='.
       LOOP-REC.
           READ INPREC1 AT END GO TO ENDLOOP1.
           IF INPREC1-STATUS > 02 GO TO PRIMSEQIOERW1.
           ADD 1 TO COUNTREC.
           MOVE FUNCTION MOD (INP-DOACCT 10000) TO MOD-COUNTREC.
           IF MOD-COUNTREC = ZERO
           THEN
             DISPLAY '  ' INP-DOACCT ' RECORDS READ'
           END-IF.
           IF DISPLAY-RECS > 0
             DISPLAY 'RECORD  '  INP-DOACCT.
           GO TO LOOP-REC.
       ENDLOOP1.
         DISPLAY '================================================='.
         DISPLAY ' NUMBER OF RECORDS PROCESSED = ' COUNTREC.
         CLOSE INPREC1.
	        STOP RUN.
       PRIMSEQIOERW1.
         DISPLAY ' ERROR WRITING INPUT1 FILE. STATUS = ' INPREC1-STATUS.
         MOVE INPREC1-STATUS TO CONDCODE.
         CLOSE INPREC1.
         CALL "CCF_SET_CONDCODE" USING CONDCODE.
         STOP RUN.
       ABTPRIMSEQINP1.
         DISPLAY ' ERROR OPENING INPUT1 FILE. STATUS = ' INPREC1-STATUS.
         MOVE INPREC1-STATUS TO CONDCODE.
         CALL "CCF_SET_CONDCODE" USING CONDCODE.
         STOP RUN.
