RPG (IBM i / AS/400) · File status code
What does Status Code 01211 mean in RPG (IBM i / AS/400)?
The program issued a READ, WRITE, UPDATE, CHAIN, or similar I/O operation against a file that was never opened, or that had already been closed - explicitly, or implicitly because an earlier I/O error forced RPG to close it.
The program issued a READ, WRITE, UPDATE, CHAIN, or similar I/O operation against a file that was never opened, or that had already been closed - explicitly, or implicitly because an earlier I/O error forced RPG to close it.
Make sure the file is open (via the cycle or an explicit OPEN) before any I/O against it, and check %STATUS after failed operations since RPG can auto-close a file on certain errors.