IDENTIFICATION DIVISION. PROGRAM-ID. MYPROG. * * Source after resolution of COPY (same for compilation Listing) * DATA DIVISION. WORKING-STORAGE SECTION. 01 MYRECORD. 05 MYRECORD-DATA PIC X(80). PROCEDURE DIVISION. MAIN. perform MYFIC-OPEN perform MYFIC-READ perform until MYFIC-EOF display MYFIC-COUNTER MYRECORD-DATA perform MYFIC-READ end-perform perform MYFIC-CLOSE goback. *--- the framework ----------------------------------------------- * copy FICREAD * replacing ==:DDN:== by ==MYFIC== * ==:LRECL:== by ==80== * ==:RECORD:== by ==MYRECORD== * . ENVIRONMENT DIVISION. FICREAD INPUT-OUTPUT SECTION. FICREAD FILE-CONTROL. FICREAD select MYFIC-FILE assign to UT-S-MYFIC. FICREAD DATA DIVISION. FICREAD FILE SECTION. FICREAD FD MYFIC-FILE FICREAD BLOCK CONTAINS 0 RECORDS FICREAD RECORDING MODE IS F. FICREAD 01 MYFIC-RECORD. FICREAD 05 PIC X(80). FICREAD WORKING-STORAGE SECTION. FICREAD 01 PIC X VALUE '0'. FICREAD 88 MYFIC-EOF VALUE '1'. FICREAD 01 MYFIC-COUNTER PIC S9(8) BINARY VALUE 0. FICREAD PROCEDURE DIVISION. FICREAD MYFIC-OPEN. FICREAD open input MYFIC-FILE. FICREAD MYFIC-READ. FICREAD read MYFIC-FILE FICREAD into MYRECORD FICREAD at end FICREAD set MYFIC-EOF to true FICREAD not at end FICREAD add 1 to MYFIC-COUNTER FICREAD end-read. FICREAD MYFIC-CLOSE. FICREAD close MYFIC-FILE. FICREAD *-----------------------------------------------------------------