RPG (IBM i / AS/400) · File status code

Status Code 01211

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.

Status Code 01211IBM i / OS/400 · ILE RPG

Condition

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.

Fix

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.

Related file status code