OPEN INPUT TESTFILE
DISPLAY 'HERE'
IF NOT WS-FS = '00'
DISPLAY 'ERROR OPENING FILE'
END-IF
PERFORM UNTIL WS-EOF = 'Y'
READ TESTFILE
AT END MOVE 'Y' TO WS-EOF
DISPLAY 'INSIDE READ'
MOVE ACCOUNT(7:10) TO WS-CUST-KEY
DISPLAY ACCOUNT
INSPECT WS-CUST-KEY CONVERTING '0123456789' TO 'ABCDEFGHIJ'
DISPLAY 'WS-CUST-KEY..' WS-CUST-KEY
END-READ
END-PERFORM
CLOSE TESTFILE
DISPLAY 'HERE'
IF NOT WS-FS = '00'
DISPLAY 'ERROR OPENING FILE'
END-IF
PERFORM UNTIL WS-EOF = 'Y'
READ TESTFILE
AT END MOVE 'Y' TO WS-EOF
DISPLAY 'INSIDE READ'
MOVE ACCOUNT(7:10) TO WS-CUST-KEY
DISPLAY ACCOUNT
INSPECT WS-CUST-KEY CONVERTING '0123456789' TO 'ABCDEFGHIJ'
DISPLAY 'WS-CUST-KEY..' WS-CUST-KEY
END-READ
END-PERFORM
CLOSE TESTFILE
I need to read the sequential file till end
but as per my code it only display the last record of the sequential file instead of all records.